Skip to content

Example needed with MDX #25

@muratcorlu

Description

@muratcorlu

I'm trying to use this addon for documenting our web component library but couldn't figure out how to use it. Here is my related part of my MDX doc:

import { CssPropsBlock } from "@ljcl/storybook-addon-cssprops";

export const Template = (args) => html`<gr-button 
    ?secondary=${args.variant === 'secondary'} 
    ?disabled=${args.disabled} 
    ?block=${args.block} 
    ?medium=${args.size === 'medium'} 
    ?small=${args.size === 'small'}>${args.label}</gr-button>`;

# Button

Button component is the component for triggering actions.

## Button Variants

Primary button is used for main actions of the screens. Like a submit button in a form or main button of a dialog.

<Canvas>
  <Story name="Primary Button" args={{ variant: 'primary', label: 'Save' }}>
    {Template.bind({})}
  </Story>
  <Story name="Secondary Button" args={{ variant: 'secondary', label: 'Save' }}>
    {Template.bind({})}
  </Story>
</Canvas>

<CssPropsBlock
  customProperties={{
    "gr-button-display": {
      value: "inline-block",
      description: "Set display of button"
    }
  }}
/>

When I run this I can see the reference chart

image

But changing the value doesn't effect anything. How should I use those variables within every stories?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions