Skip to content

ComponentsMessage components

SourceSource

Action Row

The row of buttons and selects attached under a message.

The row of buttons and selects attached under a message. Compose it from the exported registry parts so local content and behaviour stay in the application while the visual contract stays token-driven.

Root class newt-action-row
import { ActionRow } from "@/registry/bases/newt/ui/action-row"
import { Button } from "@/registry/bases/newt/ui/button"

export default function ActionRowDemo() {
  return (
    <ActionRow aria-label="Message actions">
      <Button variant="primary">Accept</Button>
      <Button variant="secondary">Decline</Button>
    </ActionRow>
  )
}
<script setup lang="ts">
import { ActionRow } from "~~/registry/bases/newt/ui/action-row"
import { Button } from "~~/registry/bases/newt/ui/button"
</script>

<template>
  <ActionRow aria-label="Message actions">
    <Button variant="primary">Accept</Button>
    <Button variant="secondary">Decline</Button>
  </ActionRow>
</template>

Installation

npx newtui@latest add action-rownpx shadcn@latest add @newtui/action-rownpx shadcn-vue@latest add @newtui/action-rowpnpm dlx newtui@latest add action-rowpnpm dlx shadcn@latest add @newtui/action-rowpnpm dlx shadcn-vue@latest add @newtui/action-rowyarn dlx newtui@latest add action-rowyarn dlx shadcn@latest add @newtui/action-rowyarn dlx shadcn-vue@latest add @newtui/action-rowbunx newtui@latest add action-rowbunx shadcn@latest add @newtui/action-rowbunx shadcn-vue@latest add @newtui/action-rowdeno run -A npm:newtui@latest add action-rowdeno run -A npm:shadcn@latest add @newtui/action-rowdeno run -A npm:shadcn-vue@latest add @newtui/action-rowvlx newtui@latest add action-rowvlx shadcn@latest add @newtui/action-rowvlx shadcn-vue@latest add @newtui/action-rowvp dlx newtui@latest add action-rowvp dlx shadcn@latest add @newtui/action-rowvp dlx shadcn-vue@latest add @newtui/action-rownubx newtui@latest add action-rownubx shadcn@latest add @newtui/action-rownubx shadcn-vue@latest add @newtui/action-rownlx newtui@latest add action-rownlx shadcn@latest add @newtui/action-rownlx shadcn-vue@latest add @newtui/action-rowupx newtui@latest add action-rowupx shadcn@latest add @newtui/action-rowupx shadcn-vue@latest add @newtui/action-row

The shadcn CLI needs the @newtui registry in your components.json. Set it up.

Add the components it builds on

Copy the source into your project

import * as React from "react"

import { cn } from "@/lib/utils"

/*
 * The row of interactive components under a message. Discord fits five per
 * row, so stack rows when a message needs more than that.
 */
const ActionRow = React.forwardRef<
  HTMLDivElement,
  React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
  <div
    ref={ref}
    role="group"
    className={cn("flex flex-wrap items-center gap-2 [&+&]:mt-2", className)}
    {...props}
  />
))
ActionRow.displayName = "ActionRow"

export { ActionRow }
<script setup lang="ts">
import type { HTMLAttributes } from "vue"

import { cn } from "@/lib/utils"

const props = defineProps<{ class?: HTMLAttributes["class"] }>()
</script>

<!--
  The row of interactive components under a message. Discord fits five per
  row, so stack rows when a message needs more than that.
-->
<template>
  <div
    role="group"
    :class="cn('flex flex-wrap items-center gap-2 [&+&]:mt-2', props.class)"
  >
    <slot />
  </div>
</template>
export { default as ActionRow } from "./ActionRow.vue"

Update the import paths

The files import @/lib/utils and sibling components through the aliases in your components.json. Point them at wherever those live in your project.

No CLI, no components.json: paste this into Claude, Cursor, Copilot or any coding assistant and it adds Action Row to your React project by hand. The prompt carries the source of every file the CLI would write — this component's and those of the components it builds on — with the imports already pointed at the default aliases.

No CLI, no components.json: paste this into Claude, Cursor, Copilot or any coding assistant and it adds Action Row to your Vue project by hand. The prompt carries the source of every file the CLI would write — this component's and those of the components it builds on — with the imports already pointed at the default aliases.

Usage

import { ActionRow } from "@/components/ui/action-row"

export function Example() {
  return <ActionRow />
}
<script setup lang="ts">
import { ActionRow } from "@/components/ui/action-row"
</script>

<template>
  <ActionRow />
</template>

API reference

ActionRow

PropType
children / default slot?React.ReactNode / Vue slot

Content rendered inside the component.

TypeReact.ReactNode / Vue slot
className / class?string

Additional classes merged with the component defaults.

Typestring

The registry exports ActionRow. Parts without a table accept the native attributes for the element they render; React uses className, while Vue uses class and fallthrough attributes.

Accessibility

Preserve the native semantics of the rendered elements and pass through ARIA attributes when the surrounding context needs a label or description. Any interactive child needs a visible focus indicator, and meaning must not rely on colour alone.

Tokens

Action Row reads its colours, radii and motion from the --newt-* tokens installed with the library. Override a token and every component that reads it follows, including this one — see the token layer. In the plain HTML and CSS distribution the same component is newt-action-row.