How to use the @ui5/webcomponents-react/lib/ContentDensity.ContentDensity.Cozy function in @ui5/webcomponents-react

To help you get started, we’ve selected a few @ui5/webcomponents-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / ui5-webcomponents-react / packages / docs / .storybook / config.js View on Github external
const iframe = window.parent.document.getElementById('storybook-preview-iframe');
      const [base, search] = iframe.src.split('?');
      const currentQuery = qs.parse(search, { ignoreQueryPrefix: true });
      iframe.src = `${base}?${qs.stringify({ ...currentQuery, ...queryObj })}`;
    }

    let contentDensity;
    try {
      const iframe = window.parent.document.getElementById('storybook-preview-iframe');
      const currentQuery = qs.parse(iframe.src.split('?')[1]);
      contentDensity =
        currentQuery['sap-ui-compactSize'] && currentQuery['sap-ui-compactSize'] !== 'false'
          ? ContentDensity.Compact
          : ContentDensity.Cozy;
    } catch (e) {
      contentDensity = ContentDensity.Cozy;
    }

    return (
      
        {getStory(context)}
      
    );
  }
});
github SAP / ui5-webcomponents-react / packages / docs / .storybook / config.js View on Github external
wrapper: (getStory, context) => {
    function setQueryParam(queryObj) {
      const iframe = window.parent.document.getElementById('storybook-preview-iframe');
      const [base, search] = iframe.src.split('?');
      const currentQuery = qs.parse(search, { ignoreQueryPrefix: true });
      iframe.src = `${base}?${qs.stringify({ ...currentQuery, ...queryObj })}`;
    }

    let contentDensity;
    try {
      const iframe = window.parent.document.getElementById('storybook-preview-iframe');
      const currentQuery = qs.parse(iframe.src.split('?')[1]);
      contentDensity =
        currentQuery['sap-ui-compactSize'] && currentQuery['sap-ui-compactSize'] !== 'false'
          ? ContentDensity.Compact
          : ContentDensity.Cozy;
    } catch (e) {
      contentDensity = ContentDensity.Cozy;
    }

    return (
      
        {getStory(context)}
      
    );
  }
});
github SAP / ui5-webcomponents-react / packages / main / src / components / ThemeProvider / index.tsx View on Github external
const themeContext = useMemo(() => {
    return {
      theme,
      contentDensity: isCompactSize ? ContentDensity.Compact : ContentDensity.Cozy,
      parameters: sap_fiori_3
    };
  }, [theme, isCompactSize]);
github SAP / ui5-webcomponents-react / packages / main / src / components / ObjectPage / index.tsx View on Github external
const renderHideHeaderButton = () => {
    if (!showHideHeaderButton || renderHeaderContentProp === null) return null;

    const { contentDensity } = theme as JSSTheme;

    return (
      <button style="{">
    );
  };
</button>

@ui5/webcomponents-react

React Wrapper for UI5 Web Components and additional components

Apache-2.0
Latest version published 4 days ago

Package Health Score

90 / 100
Full package analysis

Similar packages