Skip to content

Commit 8e9c276

Browse files
committed
docs(Icons): add content in the MDX
1 parent 5108f17 commit 8e9c276

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
import { Meta } from "@storybook/addon-docs/blocks";
22

33
<Meta title="Icons/Using the icons" />
4+
5+
# Using the icons
6+
7+
## With React
8+
9+
The icons are available as React components in the `@qlik/sprout-icons/react` package. You can import them directly from the package and use them in your React application.
10+
11+
```tsx
12+
import { AddIcon } from "@qlik/sprout-icons/react";
13+
14+
function MyComponent() {
15+
return <AddIcon />;
16+
}
17+
```
18+
19+
They accept any SVGSVGElement props
20+
21+
## With VueJS
22+
23+
The icons are available as Vue components in the `@qlik/sprout-icons/vue` package.

packages/storybook/src/icons/icons.stories.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export default meta;
1212

1313
const SIZES = ["s", "m", "l", "xl", "xxl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl"] as const;
1414

15+
function removeTrailingIconFromName(name: string) {
16+
return name.endsWith("Icon") ? name.slice(0, -4) : name;
17+
}
18+
1519
export const AllIcons = {
1620
render: () => {
1721
const [search, setSearch] = useState("");
@@ -50,7 +54,9 @@ export const AllIcons = {
5054
className={classNames("flex", "flex-col", "gap-m", "p-m", "border-default", "radius-soft")}
5155
style={{ blockSize: 150, inlineSize: 150 }}
5256
>
53-
<span className={classNames("font-script-s", "text-weak", "break-all")}>{name}</span>
57+
<span className={classNames("font-script-s", "text-weak", "break-all")}>
58+
{removeTrailingIconFromName(name)}
59+
</span>
5460
<div className={classNames("flex", "items-center", "justify-center", "flex-1", "text-default")}>
5561
<Icon className={classNames(`size-${size}`)} />
5662
</div>

0 commit comments

Comments
 (0)