DefaultGroupStatesInteractionContainerSizePressedSelectedDisabledInvokerCommandWithIconFlatInlineLinkSelectedFlatLinkFlatNoWrapFormSubmitFormControlPopoverBackgroundOverrideValidLinkButtonInvalidLinkButtonProgressDisclosureContrastColoredBackgrounds
A button is a widget that enables users to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.
<div nve-layout="row gap:xs">
<nve-button>standard</nve-button>
<nve-button selected>selected</nve-button>
<nve-button pressed>pressed</nve-button>
<nve-button disabled>disabled</nve-button>
</div>
standard
selected
pressed
disabled
Edit Example
Button interaction states including hover, focus, pressed, selected, and disabled.
<div nve-layout="row gap:xs">
<nve-button>standard</nve-button>
<nve-button interaction="emphasis">emphasis</nve-button>
<nve-button interaction="destructive">destructive</nve-button>
</div>
standard
emphasis
destructive
Edit Example
The Interaction type provides a way to show the intent of an interactive element. This can help users quickly understand what each interaction does and reduce the potential for confusion or errors.
Interaction Description emphasis Shows the interaction targets emphasis or highlighting primary actions. destructive Shows the interaction targets destructive actions such as deleting or removing.
<div nve-layout="row gap:xs align:vertical-center">
<nve-button container="inline">inline</nve-button>
<nve-button container="flat">flat</nve-button>
<nve-button>default</nve-button>
</div>
Edit Example
Demonstrates different container styles to accommodate visual weight and context.
Container Description flat Element has white space bounds but reduced visual container. inline Element container reduces to fit within inline content such as a block of text.
<div nve-layout="row gap:xs">
<nve-button size="sm">small button</nve-button>
<nve-button>standard button</nve-button>
<nve-button size="lg">large button</nve-button>
</div>
small button
standard button
large button
Edit Example
Controls the visual scale of an element to match its importance and available space.
Size Description sm Compact size for dense layouts or secondary elements with less visual prominence. md Standard size that works well in most contexts and provides balanced visibility. lg Larger size for emphasizing important elements or improving touch targets in spacious layouts.
<div nve-layout="row gap:xs align:vertical-center">
<nve-button pressed container="inline">pressed inline</nve-button>
<nve-button pressed container="flat">pressed flat</nve-button>
<nve-button pressed>pressed</nve-button>
</div>
pressed inline
pressed flat
pressed
Edit Example
Indicates the current state of a toggle button that switches on or off. MDN
Pressed Description true The button is in the pressed (on) state and the associated action or setting is active. false The button is in the unpressed (off) state and the associated action or setting is inactive.
<div nve-layout="row gap:xs align:vertical-center">
<nve-button selected container="inline">selected inline</nve-button>
<nve-button selected container="flat">selected flat</nve-button>
<nve-button selected>selected</nve-button>
</div>
selected inline
selected flat
selected
Edit Example
Indicates whether an element currently holds selection within a multi-option selection group. MDN
Selected Description true The element holds selection and represents the user's current choice within the group. false The element does not hold selection and the user can choose it.
<div nve-layout="row gap:xs align:vertical-center">
<nve-button disabled container="inline">disabled inline</nve-button>
<nve-button disabled container="flat">disabled flat</nve-button>
<nve-button disabled>disabled</nve-button>
</div>
disabled inline
disabled flat
disabled
Edit Example
This Boolean attribute prevents the user from interacting with the element: it cannot receive press or focus events. MDN
Disabled Description true The element has a disabled state and does not accept interaction. false The element has an enabled state and accepts interaction.
<nve-icon
id="rotation-target"
name="sparkles"
aria-label="sparkles icon"
style="inline-size: 100px; block-size: 100px"
></nve-icon>
<section>
<nve-button commandfor="rotation-target" command="--rotate-left">Rotate left</nve-button>
<nve-button commandfor="rotation-target" command="--rotate-right">Rotate right</nve-button>
<nve-button commandfor="popover" command="toggle-popover">toggle-popover</nve-button>
</section>
<nve-toggletip id="popover">popover</nve-toggletip>
<script type="module">
const target = document.getElementById("rotation-target");
target.addEventListener("command", (event) => {
if (event.command === "--rotate-left") {
target.style.rotate = "-90deg";
} else if (event.command === "--rotate-right") {
target.style.rotate = "90deg";
}
});
</script>
Rotate left
Rotate right
toggle-popover
popover
Edit Example
Use the commandfor and command attributes to trigger custom Invoker Commands, such as rotating an image.
<nve-button><nve-icon name="person"></nve-icon> button</nve-button>
<nve-button>button <nve-icon name="person"></nve-icon></nve-button>
Edit Example
Button with icons positioned before or after text to enhance visual clarity and user understanding.
<div nve-layout="row gap:xs">
<nve-button container="flat">standard</nve-button>
<nve-button container="flat" interaction="emphasis">emphasis</nve-button>
<nve-button container="flat" interaction="destructive">destructive</nve-button>
<nve-button container="flat" disabled>disabled</nve-button>
</div>
standard
emphasis
destructive
disabled
Edit Example
Flat button style for secondary actions with minimal visual weight, maintaining clear interaction states.
<div nve-layout="row gap:xs">
<nve-button container="inline">standard</nve-button>
<nve-button container="inline" interaction="emphasis">emphasis</nve-button>
<nve-button container="inline" interaction="destructive">destructive</nve-button>
<nve-button container="inline" disabled>disabled</nve-button>
</div>
standard
emphasis
destructive
disabled
Edit Example
Inline button style for text-like actions that blend with content while maintaining button functionality.
<div nve-layout="row gap:xs">
<nve-button><a href="#">standard</a></nve-button>
<nve-button interaction="emphasis"><a href="#">emphasis</a></nve-button>
<nve-button interaction="destructive"><a href="#">destructive</a></nve-button>
<nve-button disabled><a href="#">disabled</a></nve-button>
</div>
Edit Example
Button styling applied to links for consistent visual treatment while maintaining semantic navigation behavior.
<div nve-layout="row gap:xs">
<nve-button selected container="flat">selected</nve-button>
<nve-button container="flat">unselected</nve-button>
</div>
Edit Example
Flat button selection state for choice groups where one option is active, providing clear selection feedback.
<div nve-layout="row gap:xs">
<nve-button container="flat"><a href="#">flat</a></nve-button>
<nve-button container="flat" interaction="emphasis"><a href="#">flat emphasis</a></nve-button>
<nve-button container="flat" interaction="destructive"><a href="#">flat destructive</a></nve-button>
</div>
Edit Example
Flat button styling for navigation links, providing subtle visual treatment for secondary navigation actions.
<nve-button style="--width: 100px">item item item</nve-button>
<nve-button style="--width: 100px"> <span>item</span><span>item</span><span>item</span> </nve-button>
item item item
itemitemitem
Edit Example
Text wrapping behavior in constrained widths, where content adapts to available space.
<form id="test-form">
<nve-button name="test-button" value="test-value">submit</nve-button>
</form>
<script type="module">
const form = document.querySelector("#test-form");
const button = document.querySelector('[name="test-button"]');
button.addEventListener("click", (e) => console.log(e));
form.addEventListener("submit", (e) => {
e.preventDefault();
console.log(Object.fromEntries(new FormData(form, e.submitter)));
});
</script>
Edit Example
Form submission button with proper form integration and data handling for user input processing.
<div nve-layout="row gap:xs" style="max-width: 400px">
<nve-search>
<input type="search" placeholder="search" aria-label="search" />
</nve-search>
<nve-button nve-control>filter option <nve-icon name="caret" direction="down" size="sm"></nve-icon></nve-button>
</div>
Edit Example
Use the form control option for buttons that open custom controls such as dropdowns, filter menus, or pickers within a form layout. This pattern keeps the UI cohesive and helps users recognize the button as part of the form.
<div popover id="popover-example">popover</div>
<nve-button popovertarget="popover-example">toggle</nve-button>
Edit Example
Button integrated with popover API to trigger contextual overlays, providing extra information or controls.
<style>
nve-button.custom {
--color: var(--nve-sys-text-black-color);
--background-image: linear-gradient(340deg, rgb(255 234 177) 0%, var(--nve-ref-color-yellow-amber-900) 60%);
&:hover {
--background-image: linear-gradient(
340deg,
rgb(255 234 177) 0%,
color-mix(in oklab, var(--nve-ref-color-yellow-amber-900) 100%, #000 4%) 60%
);
}
}
</style>
<nve-button class="custom">Create Account</nve-button>
<nve-button>Create Account</nve-button>
Create Account
Create Account
Edit Example
Override button appearance with custom CSS properties for brand-specific designs while maintaining functionality.
<nve-button><a href="#">default</a></nve-button>
Edit Example
Button styled as a link by slotting an anchor tag inside. Use when an action needs button visual treatment while maintaining semantic link navigation and accessibility.
<a href="#"><nve-button>default</nve-button></a>
Edit Example
Do not wrap buttons in anchor tags.
<nve-button>
<nve-progress-ring status="neutral" size="xxs"></nve-progress-ring>
Submitting
</nve-button>
Edit Example
Use a progress ring within a button to communicate that an action is processing and prevent repeated submissions. Limit this pattern to short, indeterminate actions (about five seconds or less); for longer or determinate tasks, use a progress bar or ring outside the button.
<div nve-layout="column gap:lg" style="width: 280px">
<nve-toolbar status="accent">
<div nve-text="label medium sm">10 Selected</div>
<nve-button slot="suffix">Edit</nve-button>
</nve-toolbar>
<nve-alert-group status="danger">
<nve-alert> Error Detected <nve-button slot="actions" container="flat">Review</nve-button> </nve-alert>
</nve-alert-group>
<nve-card style="width: 280px">
<nve-card-content
style="
width: 100%;
height: 100%;
aspect-ratio: 16/9;
object-fit: cover;
background: repeating-conic-gradient(var(--nve-sys-layer-overlay-background) 0% 25%, transparent 0% 50%) 50% /
40px 40px;
background-position: center;
border-style: hidden;
"
>
</nve-card-content>
<nve-card-footer>
<div nve-layout="row gap:xs">
<nve-button container="flat" style="margin-left: auto">Cancel</nve-button>
<nve-button>action</nve-button>
</div>
</nve-card-footer>
</nve-card>
</div>
10 Selected
Edit
Error Detected
Review
Edit Example
Use standard interaction styling to keep buttons readable on contrasting backgrounds in light and dark themes. This pattern verifies the static button colors that deliver the intended contrast for each theme.