Skip to content

Commit

Permalink
chore: alert doc improved
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgarciadev committed Dec 5, 2024
1 parent edead49 commit 70080de
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/docs/content/components/alert/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import withIcon from "./with-icon";
import withAction from "./with-action";
import controlled from "./controlled";
import withoutIcon from "./without-icon";
import withoutIconWrapper from "./without-icon-wrapper";

export const alertContent = {
colors,
Expand All @@ -20,4 +21,5 @@ export const alertContent = {
withAction,
controlled,
withoutIcon,
withoutIconWrapper,
};
15 changes: 15 additions & 0 deletions apps/docs/content/components/alert/without-icon-wrapper.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {Alert} from "@nextui-org/react";

export default function App() {
return (
<div className="flex items-center justify-center w-full">
<Alert
hideIconWrapper
color="secondary"
description="This is a bordered variant alert"
title="Bordered Alert"
variant="bordered"
/>
</div>
);
}
9 changes: 9 additions & 0 deletions apps/docs/content/components/alert/without-icon-wrapper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./without-icon-wrapper.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
6 changes: 6 additions & 0 deletions apps/docs/content/docs/components/alert.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ You can hide the icon by setting the `hideIcon` prop to `true`.

<CodeDemo title="Without Icon" files={alertContent.withoutIcon} />

### Without Icon Wrapper

You can hide the icon wrapper by setting the `hideIconWrapper` prop to `true`.

<CodeDemo title="Without Icon Wrapper" files={alertContent.withoutIconWrapper} />

### With Action

Alert supports an `endContent` prop for additional actions.
Expand Down

0 comments on commit 70080de

Please sign in to comment.