Skip to content

Commit

Permalink
Merge pull request #51 from deepumandal/30-skeleton
Browse files Browse the repository at this point in the history
 feat: skeleton
  • Loading branch information
deepumandal authored Aug 4, 2024
2 parents ba83832 + 47a5414 commit e1f6ad4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
ContextMenu,
Tooltip,
HoverCard,
Skeleton,
} from "@Components/ui";

const App = () => (
Expand Down Expand Up @@ -187,6 +188,14 @@ const App = () => (
<Flex asElement="section" className="w-full">
<HoverCardDemo />
</Flex>

<Flex asElement="section" className="w-full space-x-2" alignItems="center">
<Skeleton className="h-12 w-12 rounded-full" />
<div className="space-y-2">
<Skeleton className="h-4 w-[250px]" />
<Skeleton className="h-4 w-[200px]" />
</div>
</Flex>
</Container>
);

Expand Down
13 changes: 13 additions & 0 deletions src/components/ui/Skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { cn } from "@Utils/className";

const Skeleton = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn("animate-pulse rounded-md bg-muted-light/20", className)}
{...props}
/>
);

export { Skeleton };
1 change: 1 addition & 0 deletions src/components/ui/Skeleton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Skeleton";
1 change: 1 addition & 0 deletions src/components/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ export { Checkbox } from "./CheckBox";
export { ContextMenu } from "./ContextMenu";
export { Tooltip } from "./ToolTip";
export { HoverCard } from "./HoverCard";
export { Skeleton } from "./Skeleton";

0 comments on commit e1f6ad4

Please sign in to comment.