@frontify/sidebar-settings
TypeScript icon, indicating that this package has built-in type declarations

0.9.17 • Public • Published

Sidebar Settings

Provides the settings types for the guideline-blocks.

Example

/* (c) Copyright Frontify Ltd., all rights reserved. */

import { BlockSettings, Bundle } from '@frontify/guideline-blocks-settings';
import { IconEnum } from '@frontify/fondue';

export const settings: BlockSettings = {
    main: [
        {
            id: 'example',
            type: 'dropdown',
            size: 'Large',
            defaultValue: 'solid',
            choices: [
                {
                    value: 'noline',
                    icon: IconEnum.LineSpacer,
                    label: 'Spacer (no line)',
                },
                {
                    value: 'solid',
                    icon: IconEnum.LineSolid,
                    label: 'Line',
                },
            ],
            onChange: (bundle: Bundle): void => {
                const blockWidth = Number(bundle.getBlock('widthCustom')?.value);
                if (!Number.isNaN(blockWidth)) {
                    bundle.setBlockValue('widthCustom', `${blockWidth}%`);
                }
            },
        },
    ],
};

Readme

Keywords

none

Package Sidebar

Install

npm i @frontify/sidebar-settings

Weekly Downloads

1,867

Version

0.9.17

License

none

Unpacked Size

220 kB

Total Files

63

Last publish

Collaborators

  • jmatyas
  • jamieatfrontify
  • frontify-dev
  • samuel.alev