Extension Components
These UI components are available to Superset extension developers through the @apache-superset/core/ui package. They provide a consistent look and feel with the rest of Superset and are designed to be used in extension panels, views, and other UI elements.
Available Components
Usage
All components are exported from the @apache-superset/core/ui package:
import { Alert } from '@apache-superset/core/ui';
export function MyExtensionPanel() {
return (
<Alert type="info">
Welcome to my extension!
</Alert>
);
}
Adding New Components
Components in @apache-superset/core/ui are automatically documented here. To add a new extension component:
- Add the component to
superset-frontend/packages/superset-core/src/ui/components/ - Export it from
superset-frontend/packages/superset-core/src/ui/components/index.ts - Create a Storybook story with an
Interactiveexport:
export default {
title: 'Extension Components/MyComponent',
component: MyComponent,
parameters: {
docs: {
description: {
component: 'Description of the component...',
},
},
},
};
export const InteractiveMyComponent = (args) => <MyComponent {...args} />;
InteractiveMyComponent.args = {
variant: 'primary',
disabled: false,
};
InteractiveMyComponent.argTypes = {
variant: {
control: { type: 'select' },
options: ['primary', 'secondary'],
},
disabled: {
control: { type: 'boolean' },
},
};
- Run
yarn startindocs/- the page generates automatically!
Interactive Documentation
For interactive examples with controls, visit the Storybook.