Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add EmptyState documentation #4488

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions apps/docs/src/pages/components/empty-state.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import {
emptyStateClasses,
HvEmptyState,
} from "@hitachivantara/uikit-react-core";
import { Info } from "@hitachivantara/uikit-react-icons";

import Playground from "@docs/components/code/Playground";
import { Description } from "@docs/components/page/Description";
import { Page } from "@docs/components/page/Page";
import { getComponentData } from "@docs/utils/component";

export const getStaticProps = async ({ params }) => {
const meta = await getComponentData("EmptyState", "core", emptyStateClasses);
return { props: { ssg: { meta } } };
};

<Description />

<Page>

<Playground
Component={HvEmptyState}
componentName="HvEmptyState"
controls={{
title: {
defaultValue: "No data routes",
},
message: {
defaultValue:
"After you start adding Data Routes, they will appear here.",
},
action: {
defaultValue: "Check the documentation for help.",
},
}}
componentProps={{
icon: <Info />,
}}
/>

### Action links

You can specify any content as the `message` or `action`. This can be a button, a link, or any other component that you want to use to guide the user to the next step.

```tsx live
<HvEmptyState
title="No visualization data available"
icon={<BarChart />}
action={
<div className="flex flex-col gap-1 items-center">
<HvButton variant="secondarySubtle">Upload data</HvButton>
<HvTypography link component="a" href="#">
Back to homepage
</HvTypography>
</div>
}
/>
```

</Page>
Loading