docs/developer_docs/extensions/components/index.mdx
These UI components are available to Superset extension developers through the @apache-superset/core/components 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.
All components are exported from the @apache-superset/core/components package:
import { Alert } from '@apache-superset/core/components';
export function MyExtensionPanel() {
return (
<Alert type="info">
Welcome to my extension!
</Alert>
);
}
Components in @apache-superset/core/components are automatically documented here. To add a new extension component:
superset-frontend/packages/superset-core/src/ui/components/superset-frontend/packages/superset-core/src/ui/components/index.tsInteractive export: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' },
},
};
yarn start in docs/ - the page generates automatically!For interactive examples with controls, visit the Storybook.