Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.2 KB
Raw Blame
import type { Meta } from '@storybook/react'

import { ButtonPrimitive } from '../Button/ButtonPrimitives'
import { WrappingLoadingSkeleton, WrappingLoadingSkeletonProps } from './WrappingLoadingSkeleton'

const meta = {
    title: 'UI/WrappingLoadingSkeleton',
    component: WrappingLoadingSkeleton as any,
    tags: ['autodocs'],
} satisfies Meta<WrappingLoadingSkeletonProps>

export default meta

export function Default(): JSX.Element {
    return (
        <div className="flex flex-col gap-4 max-w-lg">
            <p>
                The wrapping loading skeleton will wrap around the children and take the size of the children, making it
                easy to do loading states for any component (as long as you can wrap a copy of it or mimic it)
            </p>
            <WrappingLoadingSkeleton>
                <ButtonPrimitive inert aria-hidden>
                    Some invisible text
                </ButtonPrimitive>
            </WrappingLoadingSkeleton>
            <WrappingLoadingSkeleton>
                <ButtonPrimitive inert aria-hidden>
                    small
                </ButtonPrimitive>
            </WrappingLoadingSkeleton>
        </div>
    )
}