docs/developer_docs/components/ui/button.mdx
import { StoryWithControls, ComponentGallery } from '../../../src/components/StorybookWrapper';
The Button component from Superset's UI library.
<ComponentGallery component="Button" sizes={["xsmall","small","default"]} styles={["primary","secondary","dashed","danger","link"]} sizeProp="buttonSize" styleProp="buttonStyle" />
<StoryWithControls component="Button" props={{ buttonStyle: "default", buttonSize: "default", children: "Button!" }} controls={[ { name: "buttonStyle", label: "Button Style", type: "select", options: [ "primary", "secondary", "dashed", "danger", "link" ], description: "The style variant of the button." }, { name: "buttonSize", label: "Button Size", type: "select", options: [ "xsmall", "small", "default" ], description: "The size of the button." }, { name: "children", label: "Children", type: "text", description: "The button text or content." }, { name: "target", label: "Target", type: "select" }, { name: "href", label: "Href", type: "select" }, { name: "disabled", label: "Disabled", type: "boolean", description: "Whether the button is disabled." }, { name: "loading", label: "Loading", type: "boolean", description: "Whether to show loading spinner." } ]} />
Edit the code below to experiment with the component:
function Demo() {
return (
<Button
buttonStyle="default"
buttonSize="default"
>
Button!
</Button>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
buttonStyle | string | "default" | The style variant of the button. |
buttonSize | string | "default" | The size of the button. |
children | string | "Button!" | The button text or content. |
import { Button } from '@superset/components';
:::tip[Improve this page] This documentation is auto-generated from the component's Storybook story. Help improve it by editing the story file. :::