Skip to content

Commit

Permalink
docs(alert, dropdown): add missing import docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eTallang committed Jan 9, 2025
1 parent 5770580 commit 6cb755c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/lib/components/alert/Overview.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Canvas, Meta, Subtitle, Title } from '@storybook/blocks';
import { Canvas, Meta, Source, Subtitle, Title } from '@storybook/blocks';

import * as stories from './alert.stories';

Expand All @@ -10,6 +10,21 @@ import * as stories from './alert.stories';
attention to help make informed actions and decisions.
</Subtitle>

## How to get started
Start by importing the component. If you import the web component version, the `<cx-alert>` component is available for use
from the point of the import and further down the application-tree.
<Source
code={`
// Web component
import '@computas/designsystem/alert';
// React
import { CxAlert } from '@computas/designsystem/alert/react';
`}
language="typescript"
dark
/>

### Local alert

This alert should be placed next to the content it is related to and should not be confused with toast (pops up and disappear) or global alerts (static at the top of the entire web-site). They should help the user correct a problem and then disappear once the problem is corrected.
Expand Down
15 changes: 15 additions & 0 deletions packages/lib/components/dropdown/Overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,20 @@ import * as stories from "./dropdown.stories";
filter, in a menu and so on.
</Subtitle>

## How to get started
Start by importing the component. If you import the web component version, both the `<cx-dropdown>` component and `<cx-option>` is available for use
from the point of the import and further down the application-tree.
<Source
code={`
// Web component
import '@computas/designsystem/dropdown';
// React
import { CxDropdown, CxOption } from '@computas/designsystem/dropdown/react';
`}
language="typescript"
dark
/>

## Default
<Canvas of={stories.Default} />

0 comments on commit 6cb755c

Please sign in to comment.