Button
A Shadcn-styled button projected through Proto UI adapters.
Buttons trigger actions. This is Proto UI’s unofficial Shadcn projection over Base Button. The previews use current workspace source in WC, React, Vue 3 and Vue 2.6; their package-install and visual acceptance results are separate.
Scroll to see all hosts →
import './styles/proto-ui-style.css';
import './button-demo.css';
import '../proto-ui/components/wc';<div id="button-demo" class="flex flex-wrap items-center justify-center gap-3">
<proto-ui-shadcn-button>Default</proto-ui-shadcn-button>
<div>
<proto-ui-shadcn-button>Default2</proto-ui-shadcn-button>
</div>
<proto-ui-shadcn-button>Outline</proto-ui-shadcn-button>
<proto-ui-shadcn-button>Destructive</proto-ui-shadcn-button>
<proto-ui-shadcn-button><span aria-hidden="true">+</span><span class="sr-only">Add</span></proto-ui-shadcn-button>
<proto-ui-shadcn-button>Disabled</proto-ui-shadcn-button>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const props = [
{ styleProfile: 'rhea' },
{ styleProfile: 'rhea' },
{ styleProfile: 'rhea', variant: 'outline' },
{ styleProfile: 'rhea', variant: 'destructive' },
{ styleProfile: 'rhea', variant: 'ghost', size: 'icon' },
{ styleProfile: 'rhea', disabled: true },
];
document.querySelectorAll('#button-demo proto-ui-shadcn-button').forEach((button, index) => {
if (!(button instanceof HTMLElement)) throw new Error('Missing example Button');
setElementProps(button, props[index]);
});
</script>
<script type="module" src="/src/main.ts"></script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/react';
export function DemoButtonDemo() {
return (
<div className="flex flex-wrap items-center justify-center gap-3">
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
<div>
<ShadcnButton styleProfile="rhea">Default2</ShadcnButton>
</div>
<ShadcnButton styleProfile="rhea" variant="outline">Outline</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="destructive">Destructive</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="ghost" size="icon">
<span aria-hidden="true">+</span><span className="sr-only">Add</span>
</ShadcnButton>
<ShadcnButton styleProfile="rhea" disabled>Disabled</ShadcnButton>
</div>
);
}/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<script setup lang="ts">
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue';
</script>
<template>
<div class="flex flex-wrap items-center justify-center gap-3">
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
<div>
<ShadcnButton styleProfile="rhea">Default2</ShadcnButton>
</div>
<ShadcnButton styleProfile="rhea" variant="outline">Outline</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="destructive">Destructive</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="ghost" size="icon"><span aria-hidden="true">+</span><span class="sr-only">Add</span></ShadcnButton>
<ShadcnButton styleProfile="rhea" :disabled="true">Disabled</ShadcnButton>
</div>
</template>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<template>
<div class="flex flex-wrap items-center justify-center gap-3">
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
<div>
<ShadcnButton styleProfile="rhea">Default2</ShadcnButton>
</div>
<ShadcnButton styleProfile="rhea" variant="outline">Outline</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="destructive">Destructive</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="ghost" size="icon"><span aria-hidden="true">+</span><span class="sr-only">Add</span></ShadcnButton>
<ShadcnButton styleProfile="rhea" :disabled="true">Disabled</ShadcnButton>
</div>
</template>
<script>
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue2';
export default {
components: {
ShadcnButton,
},
};
</script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }Install
Section titled “Install”First initialize an existing application. The published stable 0.2.0 baseline uses:
npx @proto.ui/cli@0.2.0 add wc shadcn-button
pnpm dlx @proto.ui/cli@0.2.0 add wc shadcn-buttonReplace wc with react or vue for those stable hosts. The CLI installs @proto.ui/prototypes-shadcn and the corresponding Adapter at its own exact version and generates the local facade. Vue 2.6 (>=2.6.0 <2.7) and the named style profiles shown below require matching workspace 0.3 CLI/Adapter/Prototype source. Stable @latest does not establish that delivery; the workspace 0.3.0-alpha.1 manifest does not establish registry publication.
Usage and presentation
Section titled “Usage and presentation”Each Code panel includes registration/imports and the application’s example stylesheet. Keep the generated proto-ui-style.css import in one application entry. WC uses the generated proto-ui-shadcn-button tag; React exports a named example to render from the existing app, and Vue examples are single-file components. Adjust relative paths to the initialized project’s layout. The small layout and visually hidden-label rules are application-owned and do not require Tailwind.
The Shadcn Rhea examples request styleProfile="rhea" explicitly, matching the preview’s public Shadcn style scope. Current source recognizes vega, nova, maia, lyra, mira, luma, sera, rhea and new-york-v4; new-york is the legacy alias. Omission or inherit uses the nearest scope and then the Button’s Rhea fallback. These examples demonstrate Rhea, not visual acceptance of every profile or component.
Examples
Section titled “Examples”Variant matrix
Section titled “Variant matrix”All six current variants are shown together. link is a visual command variant; it does not supply an href or navigation behavior.
Scroll to see all hosts →
import './styles/proto-ui-style.css';
import './button-demo.css';
import '../proto-ui/components/wc';<div id="button-variants-demo" class="flex flex-wrap items-center justify-center gap-3">
<proto-ui-shadcn-button>Default</proto-ui-shadcn-button>
<proto-ui-shadcn-button>Secondary</proto-ui-shadcn-button>
<proto-ui-shadcn-button>Outline</proto-ui-shadcn-button>
<proto-ui-shadcn-button>Ghost</proto-ui-shadcn-button>
<proto-ui-shadcn-button>Destructive</proto-ui-shadcn-button>
<proto-ui-shadcn-button>Link</proto-ui-shadcn-button>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const props = [
{ styleProfile: 'rhea', variant: 'default' },
{ styleProfile: 'rhea', variant: 'secondary' },
{ styleProfile: 'rhea', variant: 'outline' },
{ styleProfile: 'rhea', variant: 'ghost' },
{ styleProfile: 'rhea', variant: 'destructive' },
{ styleProfile: 'rhea', variant: 'link' },
];
document.querySelectorAll('#button-variants-demo proto-ui-shadcn-button').forEach((button, index) => {
if (!(button instanceof HTMLElement)) throw new Error('Missing variant Button');
setElementProps(button, props[index]);
});
</script>
<script type="module" src="/src/main.ts"></script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/react';
export function DemoButtonVariantsDemo() {
return (
<div className="flex flex-wrap items-center justify-center gap-3">
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="secondary">Secondary</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="outline">Outline</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="ghost">Ghost</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="destructive">Destructive</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="link">Link</ShadcnButton>
</div>
);
}/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<script setup lang="ts">
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue';
</script>
<template>
<div class="flex flex-wrap items-center justify-center gap-3">
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="secondary">Secondary</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="outline">Outline</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="ghost">Ghost</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="destructive">Destructive</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="link">Link</ShadcnButton>
</div>
</template>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<template>
<div class="flex flex-wrap items-center justify-center gap-3">
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="secondary">Secondary</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="outline">Outline</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="ghost">Ghost</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="destructive">Destructive</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="link">Link</ShadcnButton>
</div>
</template>
<script>
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue2';
export default {
components: {
ShadcnButton,
},
};
</script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }Default
Section titled “Default”Scroll to see all hosts →
import './styles/proto-ui-style.css';
import './button-demo.css';
import '../proto-ui/components/wc';<div class="flex flex-wrap items-center gap-3">
<proto-ui-shadcn-button id="default-button">Default</proto-ui-shadcn-button>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const button = document.querySelector('#default-button');
if (!(button instanceof HTMLElement)) throw new Error('Missing #default-button');
setElementProps(button, { styleProfile: 'rhea' });
</script>
<script type="module" src="/src/main.ts"></script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/react';
export function DemoButtonDefaultDemo() {
return (
<div className="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
</div>
);
}/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<script setup lang="ts">
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue';
</script>
<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
</div>
</template>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
</div>
</template>
<script>
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue2';
export default {
components: {
ShadcnButton,
},
};
</script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }Secondary
Section titled “Secondary”Scroll to see all hosts →
import './styles/proto-ui-style.css';
import './button-demo.css';
import '../proto-ui/components/wc';<div class="flex flex-wrap items-center gap-3">
<proto-ui-shadcn-button id="secondary-button">Secondary</proto-ui-shadcn-button>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const button = document.querySelector('#secondary-button');
if (!(button instanceof HTMLElement)) throw new Error('Missing #secondary-button');
setElementProps(button, { styleProfile: 'rhea', variant: 'secondary' });
</script>
<script type="module" src="/src/main.ts"></script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/react';
export function DemoButtonSecondaryDemo() {
return (
<div className="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="secondary">Secondary</ShadcnButton>
</div>
);
}/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<script setup lang="ts">
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue';
</script>
<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="secondary">Secondary</ShadcnButton>
</div>
</template>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="secondary">Secondary</ShadcnButton>
</div>
</template>
<script>
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue2';
export default {
components: {
ShadcnButton,
},
};
</script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }Outline
Section titled “Outline”Scroll to see all hosts →
import './styles/proto-ui-style.css';
import './button-demo.css';
import '../proto-ui/components/wc';<div class="flex flex-wrap items-center gap-3">
<proto-ui-shadcn-button id="outline-button">Outline</proto-ui-shadcn-button>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const button = document.querySelector('#outline-button');
if (!(button instanceof HTMLElement)) throw new Error('Missing #outline-button');
setElementProps(button, { styleProfile: 'rhea', variant: 'outline' });
</script>
<script type="module" src="/src/main.ts"></script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/react';
export function DemoButtonOutlineDemo() {
return (
<div className="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="outline">Outline</ShadcnButton>
</div>
);
}/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<script setup lang="ts">
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue';
</script>
<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="outline">Outline</ShadcnButton>
</div>
</template>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="outline">Outline</ShadcnButton>
</div>
</template>
<script>
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue2';
export default {
components: {
ShadcnButton,
},
};
</script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }Scroll to see all hosts →
import './styles/proto-ui-style.css';
import './button-demo.css';
import '../proto-ui/components/wc';<div id="ghost-demo" class="flex flex-wrap items-center gap-3">
<proto-ui-shadcn-button>Ghost</proto-ui-shadcn-button>
<proto-ui-shadcn-button>Disabled ghost</proto-ui-shadcn-button>
<div role="status" aria-live="polite">Enabled activations: 0; disabled activations: 0</div>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const demo = document.querySelector('#ghost-demo');
if (!(demo instanceof HTMLElement)) throw new Error('Missing #ghost-demo');
const buttons = demo.querySelectorAll('proto-ui-shadcn-button');
const counts = [0, 0];
buttons.forEach((button, index) => {
if (!(button instanceof HTMLElement)) throw new Error('Missing Ghost Button');
setElementProps(button, { styleProfile: 'rhea', variant: 'ghost', disabled: index === 1 });
button.addEventListener('click', (event) => {
if (!(event instanceof CustomEvent) || event.target !== button) return;
counts[index]++;
demo.querySelector('[role="status"]').textContent =
'Enabled activations: ' + counts[0] + '; disabled activations: ' + counts[1];
});
});
</script>
<script type="module" src="/src/main.ts"></script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }import './styles/proto-ui-style.css';
import './button-demo.css';
import { useState } from 'react';
import { ShadcnButton } from '../proto-ui/components/react';
export function DemoButtonGhostDemo() {
const [enabled, setEnabled] = useState(0);
const [disabled, setDisabled] = useState(0);
return (
<div className="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="ghost" onClick={() => setEnabled((n) => n + 1)}>Ghost</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="ghost" disabled onClick={() => setDisabled((n) => n + 1)}>Disabled ghost</ShadcnButton>
<div role="status" aria-live="polite">Enabled activations: {enabled}; disabled activations: {disabled}</div>
</div>
);
}/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<script setup lang="ts">
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ref } from 'vue';
import { ShadcnButton } from '../proto-ui/components/vue';
const enabled = ref(0);
const disabled = ref(0);
</script>
<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="ghost" @click="enabled++">Ghost</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="ghost" :disabled="true" @click="disabled++">Disabled ghost</ShadcnButton>
<div role="status" aria-live="polite">Enabled activations: {{ enabled }}; disabled activations: {{ disabled }}</div>
</div>
</template>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="ghost" @click="enabled++">Ghost</ShadcnButton>
<ShadcnButton styleProfile="rhea" variant="ghost" :disabled="true" @click="disabled++">Disabled ghost</ShadcnButton>
<div role="status" aria-live="polite">Enabled activations: {{ enabled }}; disabled activations: {{ disabled }}</div>
</div>
</template>
<script>
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue2';
export default {
components: { ShadcnButton },
data() { return { enabled: 0, disabled: 0 }; },
};
</script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }Destructive
Section titled “Destructive”Scroll to see all hosts →
import './styles/proto-ui-style.css';
import './button-demo.css';
import '../proto-ui/components/wc';<div class="flex flex-wrap items-center gap-3">
<proto-ui-shadcn-button id="destructive-button">Destructive</proto-ui-shadcn-button>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const button = document.querySelector('#destructive-button');
if (!(button instanceof HTMLElement)) throw new Error('Missing #destructive-button');
setElementProps(button, { styleProfile: 'rhea', variant: 'destructive' });
</script>
<script type="module" src="/src/main.ts"></script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/react';
export function DemoButtonDestructiveDemo() {
return (
<div className="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="destructive">Destructive</ShadcnButton>
</div>
);
}/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<script setup lang="ts">
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue';
</script>
<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="destructive">Destructive</ShadcnButton>
</div>
</template>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" variant="destructive">Destructive</ShadcnButton>
</div>
</template>
<script>
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue2';
export default {
components: {
ShadcnButton,
},
};
</script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }Use sm, default, lg, icon or the compact icon-compact extension. icon-compact is a fixed 1.75rem square, including when wrap is enabled.
Both icon-size examples keep “Add” as visually hidden content and hide the decorative plus from the accessibility tree. The Button emits its ordinary click signal; the consuming application owns the action. A glyph alone is not an accessible label.
Scroll to see all hosts →
import './styles/proto-ui-style.css';
import './button-demo.css';
import '../proto-ui/components/wc';<div id="button-sizes-demo" class="flex flex-wrap items-center justify-center gap-3">
<proto-ui-shadcn-button>Small</proto-ui-shadcn-button>
<proto-ui-shadcn-button>Default</proto-ui-shadcn-button>
<proto-ui-shadcn-button>Large</proto-ui-shadcn-button>
<proto-ui-shadcn-button><span aria-hidden="true">+</span><span class="sr-only">Add</span></proto-ui-shadcn-button>
<proto-ui-shadcn-button><span aria-hidden="true">+</span><span class="sr-only">Add</span></proto-ui-shadcn-button>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const props = [
{ styleProfile: 'rhea', size: 'sm' },
{ styleProfile: 'rhea', size: 'default' },
{ styleProfile: 'rhea', size: 'lg' },
{ styleProfile: 'rhea', size: 'icon', variant: 'outline' },
{ styleProfile: 'rhea', size: 'icon-compact', variant: 'outline' },
];
document.querySelectorAll('#button-sizes-demo proto-ui-shadcn-button').forEach((button, index) => {
if (!(button instanceof HTMLElement)) throw new Error('Missing size Button');
setElementProps(button, props[index]);
});
</script>
<script type="module" src="/src/main.ts"></script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/react';
export function DemoButtonSizesDemo() {
return (
<div className="flex flex-wrap items-center justify-center gap-3">
<ShadcnButton styleProfile="rhea" size="sm">Small</ShadcnButton>
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
<ShadcnButton styleProfile="rhea" size="lg">Large</ShadcnButton>
<ShadcnButton styleProfile="rhea" size="icon" variant="outline">
<span aria-hidden="true">+</span><span className="sr-only">Add</span>
</ShadcnButton>
<ShadcnButton styleProfile="rhea" size="icon-compact" variant="outline">
<span aria-hidden="true">+</span><span className="sr-only">Add</span>
</ShadcnButton>
</div>
);
}/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<script setup lang="ts">
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue';
</script>
<template>
<div class="flex flex-wrap items-center justify-center gap-3">
<ShadcnButton styleProfile="rhea" size="sm">Small</ShadcnButton>
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
<ShadcnButton styleProfile="rhea" size="lg">Large</ShadcnButton>
<ShadcnButton styleProfile="rhea" size="icon" variant="outline"><span aria-hidden="true">+</span><span class="sr-only">Add</span></ShadcnButton>
<ShadcnButton styleProfile="rhea" size="icon-compact" variant="outline"><span aria-hidden="true">+</span><span class="sr-only">Add</span></ShadcnButton>
</div>
</template>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<template>
<div class="flex flex-wrap items-center justify-center gap-3">
<ShadcnButton styleProfile="rhea" size="sm">Small</ShadcnButton>
<ShadcnButton styleProfile="rhea">Default</ShadcnButton>
<ShadcnButton styleProfile="rhea" size="lg">Large</ShadcnButton>
<ShadcnButton styleProfile="rhea" size="icon" variant="outline"><span aria-hidden="true">+</span><span class="sr-only">Add</span></ShadcnButton>
<ShadcnButton styleProfile="rhea" size="icon-compact" variant="outline"><span aria-hidden="true">+</span><span class="sr-only">Add</span></ShadcnButton>
</div>
</template>
<script>
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue2';
export default {
components: {
ShadcnButton,
},
};
</script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }Disabled
Section titled “Disabled”Disabled buttons suppress activation and keep their disabled semantics across hosts.
Scroll to see all hosts →
import './styles/proto-ui-style.css';
import './button-demo.css';
import '../proto-ui/components/wc';<div class="flex flex-wrap items-center gap-3">
<proto-ui-shadcn-button id="disabled-button">Disabled</proto-ui-shadcn-button>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const button = document.querySelector('#disabled-button');
if (!(button instanceof HTMLElement)) throw new Error('Missing #disabled-button');
setElementProps(button, { styleProfile: 'rhea', disabled: true });
</script>
<script type="module" src="/src/main.ts"></script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/react';
export function DemoButtonDisabledDemo() {
return (
<div className="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" disabled>Disabled</ShadcnButton>
</div>
);
}/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<script setup lang="ts">
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue';
</script>
<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" :disabled="true">Disabled</ShadcnButton>
</div>
</template>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }<template>
<div class="flex flex-wrap items-center gap-3">
<ShadcnButton styleProfile="rhea" :disabled="true">Disabled</ShadcnButton>
</div>
</template>
<script>
import './styles/proto-ui-style.css';
import './button-demo.css';
import { ShadcnButton } from '../proto-ui/components/vue2';
export default {
components: {
ShadcnButton,
},
};
</script>/* Application-owned example layout and visually hidden labels. */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }Navigation, groups and busy state
Section titled “Navigation, groups and busy state”Use a native anchor for navigation, preserving its actual URL and full text: Read Quick Start. The equivalent application composition is:
<a href="/en/start-here/quick-start/">Read Quick Start</a>Do not put an anchor inside Button or invent asChild, href, loading or isLoading props. Base remains the activation and disabled owner. For a real asynchronous action, the application owns pending state, drives disabled, keeps a meaningful name and reports progress/completion. A spinner alone is not a busy-state or activation guard.
Ordinary layout can group independent actions. Use the documented Toolbar when its keyboard model is the intended composition. A dedicated Button Group API, loading/spinner composition, icon-and-text matrix, all-profile evidence and native-link visual comparison are still separate conditions in #1042; this pilot does not claim them complete.
API Reference
Section titled “API Reference”| Prop | Type | Default |
|---|---|---|
styleProfile | ShadcnStyleChoice (see Usage) | inherit → nearest scope → rhea |
variant | 'default' 'destructive' 'outline' 'secondary' 'ghost' 'link' | default |
size | 'default' 'sm' 'lg' 'icon' 'icon-compact' | default |
disabled | boolean | false |
wrap | boolean | false |
Lifecycle and evidence
Section titled “Lifecycle and evidence”P-SHADCN-BUTTON and P-BASE-BUTTON remain draft. The existing previews and source are not fresh package, browser, focus, screen-reader or full upstream-parity evidence. Preserve the original documentation checkpoints and Button implementation evidence with their actual revisions. Runtime switching and narrow/mobile/enlarged-text acceptance still require candidate-bound observation.