Skip to content

Skeleton ​

Neo-brutalist skeleton loading component providing sub-components for common loading patterns.

Demo ​

Preview

变体

头像尺寸

sm
default
lg
xl

骨架文本

骨架卡片

加载中...

骨架表格

基础尺寸

形状

自定义宽度

加载质感效果(effect)

Installation ​

pnpm dlx brutx-vue@latest add skeleton

Usage ​

Basic Skeleton ​

vue
<script setup>
import { Skeleton } from 'brutx-ui-vue'
</script>

<template>
    <Skeleton class="h-12 w-12" />
</template>

Shapes ​

ShapeDescription
rectRounded rectangle (rounded-brutal)
circleCircle (rounded-full) with equal width and height
vue
<template>
    <div class="flex items-center gap-4">
        <Skeleton shape="rect" size="lg" width="80px" />
        <Skeleton shape="circle" size="lg" />
    </div>
</template>

Custom Width ​

width accepts any CSS width string, including percentages. When shape="circle", it also sets the height.

vue
<template>
    <div class="space-y-2 w-full">
        <Skeleton width="100%" />
        <Skeleton width="75%" />
        <Skeleton width="50%" />
    </div>
</template>

SkeletonText ​

vue
<script setup>
import { SkeletonText } from 'brutx-ui-vue'
</script>

<template>
    <SkeletonText :lines="3" />
</template>

SkeletonAvatar ​

vue
<script setup>
import { SkeletonAvatar } from 'brutx-ui-vue'
</script>

<template>
    <SkeletonAvatar size="default" />
</template>

SkeletonCard ​

vue
<script setup>
import { SkeletonCard } from 'brutx-ui-vue'
</script>

<template>
    <SkeletonCard />
</template>

SkeletonTable ​

vue
<script setup>
import { SkeletonTable } from 'brutx-ui-vue'
</script>

<template>
    <SkeletonTable :rows="5" :columns="4" />
</template>

Variants ​

VariantDescription
defaultGray background
primaryPrimary color at 30% opacity
secondarySecondary color at 30% opacity
accentAccent color at 30% opacity

Sizes ​

SizeHeight
smh-8
defaulth-10
lgh-14
xlh-20

When shape="circle", width matches height (w-8/w-10/w-14/w-20).

vue
<template>
    <div class="space-y-2">
        <Skeleton size="sm" width="200px" />
        <Skeleton size="default" width="200px" />
        <Skeleton size="lg" width="200px" />
        <Skeleton size="xl" width="200px" />
    </div>
</template>

Loading Texture Effects ​

The effect variant overlays CRT-style texture on skeleton blocks:

EffectDescription
noneDefault pulse breathing
scanlinesOverlaid CRT scanline texture
asciiRenders flickering ASCII terminal blocks inside (customizable via the default slot)
vue
<template>
    <div class="space-y-2">
        <Skeleton effect="scanlines" width="240px" />
        <Skeleton effect="ascii" size="xl" width="240px" />
    </div>
</template>

Sub-components ​

ComponentDescription
SkeletonBasic skeleton block with built-in role="status" and aria-busy="true" accessibility attributes
SkeletonTextMulti-line skeleton text with customizable line count and last line width
SkeletonAvatarCircular avatar placeholder
SkeletonCardComplete card skeleton with image area, title, text, and button placeholders
SkeletonTableTable skeleton with built-in role="table" and aria-busy="true" accessibility attributes

API Reference ​

Skeleton

Skeleton — Props
NameTypeDefaultDescription
variant
"accent" | "default" | "primary" | "secondary" | undefined
"default"
Sets the color variant used by the skeleton placeholder.
Details

Declared type

NonNullable<"default" | "primary" | "secondary" | "accent" | null | undefined> | undefined

Literal values

  • "accent"
  • "default"
  • "primary"
  • "secondary"

Default value details

Resolved value
"default"

Source

Skeleton.vue:10

packages/ui/src/components/skeleton/Skeleton.vue

size
"default" | "lg" | "sm" | "xl" | undefined
"default"
Sets the skeleton height; when shape is circle, it also determines the circle diameter.
Details

Declared type

NonNullable<"default" | "lg" | "sm" | "xl" | null | undefined> | undefined

Literal values

  • "default"
  • "lg"
  • "sm"
  • "xl"

Default value details

Resolved value
"default"

Source

Skeleton.vue:11

packages/ui/src/components/skeleton/Skeleton.vue

shape
"circle" | "rect" | undefined
"rect"
Selects a rectangular or circular placeholder; a circle keeps equal width and height.
Details

Declared type

NonNullable<"rect" | "circle" | null | undefined> | undefined

Literal values

  • "circle"
  • "rect"

Default value details

Resolved value
"rect"

Source

Skeleton.vue:12

packages/ui/src/components/skeleton/Skeleton.vue

effect
"ascii" | "none" | "scanlines" | undefined
"none"
Selects the loading texture: none uses the default pulse, scanlines adds a CRT texture, and ascii renders flickering terminal blocks.
Details

Declared type

NonNullable<"none" | "scanlines" | "ascii" | null | undefined> | undefined

Literal values

  • "ascii"
  • "none"
  • "scanlines"

Default value details

Resolved value
"none"

Source

Skeleton.vue:14

packages/ui/src/components/skeleton/Skeleton.vue

width
string | number | undefined
undefined
Overrides the skeleton width. Numbers are converted to pixels and strings are used as CSS widths; for a circle this also sets the height.
Details

Declared type

string | number | undefined

Default value details

Resolved value
undefined

Source

Skeleton.vue:15

packages/ui/src/components/skeleton/Skeleton.vue

class
string | undefined
undefined
Additional CSS classes applied to the skeleton status container.
Details

Declared type

string | undefined

Default value details

Resolved value
undefined

Source

Skeleton.vue:16

packages/ui/src/components/skeleton/Skeleton.vue

Skeleton — Slots
NameSignature or typeDescription
#default
{}
Optional placeholder content. With the ascii effect, default terminal-block characters are rendered when this slot is empty.
Details

Declared type

{}

Source

Skeleton.vue

packages/ui/src/components/skeleton/Skeleton.vue

SkeletonAvatar

SkeletonAvatar — Props
NameTypeDefaultDescription
variant
"accent" | "default" | "primary" | "secondary" | undefined
"default"
Sets the color variant of the circular avatar placeholder.
Details

Declared type

NonNullable<"default" | "primary" | "secondary" | "accent" | null | undefined> | undefined

Literal values

  • "accent"
  • "default"
  • "primary"
  • "secondary"

Default value details

Resolved value
"default"

Source

SkeletonAvatar.vue:6

packages/ui/src/components/skeleton/SkeletonAvatar.vue

size
"default" | "lg" | "sm" | "xl" | undefined
"default"
Sets the diameter of the circular avatar placeholder.
Details

Declared type

NonNullable<"default" | "lg" | "sm" | "xl" | null | undefined> | undefined

Literal values

  • "default"
  • "lg"
  • "sm"
  • "xl"

Default value details

Resolved value
"default"

Source

SkeletonAvatar.vue:7

packages/ui/src/components/skeleton/SkeletonAvatar.vue

class
string | undefined
undefined
Additional CSS classes applied to the avatar skeleton circle.
Details

Declared type

string | undefined

Default value details

Resolved value
undefined

Source

SkeletonAvatar.vue:8

packages/ui/src/components/skeleton/SkeletonAvatar.vue

SkeletonCard

SkeletonCard — Props
NameTypeDefaultDescription
variant
"accent" | "default" | "primary" | "secondary" | undefined
"default"
Sets the color variant used by the card’s skeleton placeholders.
Details

Declared type

NonNullable<"default" | "primary" | "secondary" | "accent" | null | undefined> | undefined

Literal values

  • "accent"
  • "default"
  • "primary"
  • "secondary"

Default value details

Resolved value
"default"

Source

SkeletonCard.vue:10

packages/ui/src/components/skeleton/SkeletonCard.vue

label
string | undefined
undefined
Sets the accessible name of the card status region; an empty string falls back to the localized loading text.
Details

Declared type

string | undefined

Default value details

Resolved value
undefined

Source

SkeletonCard.vue:11

packages/ui/src/components/skeleton/SkeletonCard.vue

class
string | undefined
undefined
Additional CSS classes applied to the outer skeleton card container.
Details

Declared type

string | undefined

Default value details

Resolved value
undefined

Source

SkeletonCard.vue:12

packages/ui/src/components/skeleton/SkeletonCard.vue

SkeletonTable

SkeletonTable — Props
NameTypeDefaultDescription
variant
"accent" | "default" | "primary" | "secondary" | undefined
"default"
Sets the color variant used by the table placeholder cells.
Details

Declared type

NonNullable<"default" | "primary" | "secondary" | "accent" | null | undefined> | undefined

Literal values

  • "accent"
  • "default"
  • "primary"
  • "secondary"

Default value details

Resolved value
"default"

Source

SkeletonTable.vue:8

packages/ui/src/components/skeleton/SkeletonTable.vue

rows
number | undefined
5
Sets the placeholder data row count. It defaults to 5, non-finite values use that default, and the result is clamped from 0 to 100.
Details

Declared type

number | undefined

Default value details

Resolved value
5

Source

SkeletonTable.vue:9

packages/ui/src/components/skeleton/SkeletonTable.vue

columns
number | undefined
4
Sets the placeholder column count. It defaults to 4, non-finite values use that default, and the result is clamped from 0 to 20.
Details

Declared type

number | undefined

Default value details

Resolved value
4

Source

SkeletonTable.vue:10

packages/ui/src/components/skeleton/SkeletonTable.vue

class
string | undefined
undefined
Additional CSS classes applied to the skeleton table container.
Details

Declared type

string | undefined

Default value details

Resolved value
undefined

Source

SkeletonTable.vue:11

packages/ui/src/components/skeleton/SkeletonTable.vue

SkeletonText

SkeletonText — Props
NameTypeDefaultDescription
variant
"accent" | "default" | "primary" | "secondary" | undefined
"default"
Sets the color variant used by the text-line skeletons.
Details

Declared type

NonNullable<"default" | "primary" | "secondary" | "accent" | null | undefined> | undefined

Literal values

  • "accent"
  • "default"
  • "primary"
  • "secondary"

Default value details

Resolved value
"default"

Source

SkeletonText.vue:8

packages/ui/src/components/skeleton/SkeletonText.vue

lines
number | undefined
3
Sets the number of placeholder text lines. It defaults to 3 and is truncated and clamped from 0 to 100.
Details

Declared type

number | undefined

Default value details

Resolved value
3

Source

SkeletonText.vue:9

packages/ui/src/components/skeleton/SkeletonText.vue

lastLineWidth
string | undefined
"60%"
Sets the CSS width of the last line, defaulting to 60%; preceding lines use the full available width.
Details

Declared type

string | undefined

Default value details

Resolved value
"60%"

Source

SkeletonText.vue:10

packages/ui/src/components/skeleton/SkeletonText.vue

class
string | undefined
undefined
Additional CSS classes applied to the multi-line skeleton text container.
Details

Declared type

string | undefined

Default value details

Resolved value
undefined

Source

SkeletonText.vue:11

packages/ui/src/components/skeleton/SkeletonText.vue

Accessibility ​

  • ARIA Attributes: Skeleton has built-in role="status" and aria-busy="true"; SkeletonTable has built-in role="table" and aria-busy="true"

Brute force builds.