Skip to content

Commit 18d302a

Browse files
committed
feat(styled kit): add Skeleton component
1 parent 033179f commit 18d302a

File tree

8 files changed

+77
-0
lines changed

8 files changed

+77
-0
lines changed

.changeset/calm-nails-provide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik-ui/styled': patch
3+
---
4+
5+
feat(styled kit): add Skeleton component

apps/website/src/_state/component-statuses.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const statusByComponent: ComponentKitsStatuses = {
2323
Pagination: ComponentStatus.Draft,
2424
Popover: ComponentStatus.Draft,
2525
Separator: ComponentStatus.Beta,
26+
Skeleton: ComponentStatus.Beta,
2627
Tabs: ComponentStatus.Beta,
2728
Textarea: ComponentStatus.Draft,
2829
},

apps/website/src/routes/docs/styled/menu.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
- [Modal](/docs/styled/modal)
2020
- [Popover](/docs/styled/popover)
2121
- [Separator](/docs/styled/separator)
22+
- [Skeleton](/docs/styled/skeleton)
2223
- [Tabs](/docs/styled/tabs)
2324
- [Textarea](/docs/styled/textarea)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { Skeleton } from '@qwik-ui/styled';
3+
4+
export default component$(() => {
5+
return (
6+
<div class="flex flex-col space-y-3">
7+
<Skeleton class="h-32 w-64 rounded-3xl" />
8+
<div class="space-y-2">
9+
<Skeleton class="h-4 w-64" />
10+
<Skeleton class="h-4 w-48" />
11+
</div>
12+
</div>
13+
);
14+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { component$ } from '@builder.io/qwik';
2+
import { Skeleton } from '@qwik-ui/styled';
3+
4+
export default component$(() => {
5+
return (
6+
<div class="flex items-center space-x-4">
7+
<Skeleton class="h-12 w-12 rounded-full" />
8+
<div class="space-y-2">
9+
<Skeleton class="h-4 w-[250px]" />
10+
<Skeleton class="h-4 w-[200px]" />
11+
</div>
12+
</div>
13+
);
14+
});
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Qwik UI | Styled Skeleton Component
3+
---
4+
5+
import { statusByComponent } from '~/_state/component-statuses';
6+
7+
<StatusBanner status={statusByComponent.styled.Skeleton} />
8+
9+
# Popover
10+
11+
Visually or semantically separates content.
12+
13+
<Showcase name="hero" />
14+
15+
## Installation
16+
17+
```sh
18+
qwik-ui add skeleton
19+
```
20+
21+
## Usage
22+
23+
```tsx
24+
import { Skeleton } from '@qwik-ui/styled';
25+
```
26+
27+
```tsx
28+
<Skeleton className="h-6 w-24 rounded-full" />
29+
```
30+
31+
## Examples
32+
33+
### Card
34+
35+
<Showcase name="card" />
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { QwikIntrinsicElements, component$ } from '@builder.io/qwik';
2+
import { cn } from '@qwik-ui/utils';
3+
4+
export const Skeleton = component$<QwikIntrinsicElements['div']>(({ ...props }) => {
5+
return <div {...props} class={cn('bg-accent animate-pulse rounded', props.class)} />;
6+
});

packages/kit-styled/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export * from './components/label/label';
99
export * from './components/modal/modal';
1010
export * from './components/popover/popover';
1111
export * from './components/separator/separator';
12+
export * from './components/skeleton/skeleton';
1213
export * from './components/tabs/tabs';
1314
export * from './components/textarea/textarea';
1415
export * from './components/toggle/toggle';

0 commit comments

Comments
 (0)