Skip to content

ComponentsMessaging

SourceSource

Channel Welcome

The header that opens a channel, shown above its very first message.

The header that opens a channel, shown above its very first 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-channel-welcome
import {
  ChannelWelcome,
  ChannelWelcomeAction,
  ChannelWelcomeDate,
  ChannelWelcomeDescription,
  ChannelWelcomeIcon,
  ChannelWelcomeTitle,
} from "@/registry/bases/newt/ui/channel-welcome"

export default function ChannelWelcomeDemo() {
  return (
    <ChannelWelcome>
      <ChannelWelcomeIcon />
      <ChannelWelcomeTitle>Welcome to #general!</ChannelWelcomeTitle>
      <ChannelWelcomeDescription>
        This is the start of the #general channel. Say hello and tell us what
        you are building.
      </ChannelWelcomeDescription>
      <ChannelWelcomeAction>
        <svg viewBox="0 0 16 16" className="h-4 w-4" fill="currentColor">
          <path d="m11.3 1.7 3 3-8.4 8.4-3.6.6.6-3.6 8.4-8.4Z" />
        </svg>
        Edit Channel
      </ChannelWelcomeAction>
      <ChannelWelcomeDate dateTime="2026-01-14">
        14 January 2026
      </ChannelWelcomeDate>
    </ChannelWelcome>
  )
}
<script setup lang="ts">
import {
  ChannelWelcome,
  ChannelWelcomeAction,
  ChannelWelcomeDate,
  ChannelWelcomeDescription,
  ChannelWelcomeIcon,
  ChannelWelcomeTitle,
} from "~~/registry/bases/newt/ui/channel-welcome"
</script>

<template>
  <ChannelWelcome>
    <ChannelWelcomeIcon />
    <ChannelWelcomeTitle>Welcome to #general!</ChannelWelcomeTitle>
    <ChannelWelcomeDescription>
      This is the start of the #general channel. Say hello and tell us what you
      are building.
    </ChannelWelcomeDescription>
    <ChannelWelcomeAction>
      <svg viewBox="0 0 16 16" class="h-4 w-4" fill="currentColor">
        <path d="m11.3 1.7 3 3-8.4 8.4-3.6.6.6-3.6 8.4-8.4Z" />
      </svg>
      Edit Channel
    </ChannelWelcomeAction>
    <ChannelWelcomeDate date-time="2026-01-14">
      14 January 2026
    </ChannelWelcomeDate>
  </ChannelWelcome>
</template>

Installation

npx newtui@latest add channel-welcomenpx shadcn@latest add @newtui/channel-welcomenpx shadcn-vue@latest add @newtui/channel-welcomepnpm dlx newtui@latest add channel-welcomepnpm dlx shadcn@latest add @newtui/channel-welcomepnpm dlx shadcn-vue@latest add @newtui/channel-welcomeyarn dlx newtui@latest add channel-welcomeyarn dlx shadcn@latest add @newtui/channel-welcomeyarn dlx shadcn-vue@latest add @newtui/channel-welcomebunx newtui@latest add channel-welcomebunx shadcn@latest add @newtui/channel-welcomebunx shadcn-vue@latest add @newtui/channel-welcomedeno run -A npm:newtui@latest add channel-welcomedeno run -A npm:shadcn@latest add @newtui/channel-welcomedeno run -A npm:shadcn-vue@latest add @newtui/channel-welcomevlx newtui@latest add channel-welcomevlx shadcn@latest add @newtui/channel-welcomevlx shadcn-vue@latest add @newtui/channel-welcomevp dlx newtui@latest add channel-welcomevp dlx shadcn@latest add @newtui/channel-welcomevp dlx shadcn-vue@latest add @newtui/channel-welcomenubx newtui@latest add channel-welcomenubx shadcn@latest add @newtui/channel-welcomenubx shadcn-vue@latest add @newtui/channel-welcomenlx newtui@latest add channel-welcomenlx shadcn@latest add @newtui/channel-welcomenlx shadcn-vue@latest add @newtui/channel-welcomeupx newtui@latest add channel-welcomeupx shadcn@latest add @newtui/channel-welcomeupx shadcn-vue@latest add @newtui/channel-welcome

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

Copy the source into your project

import * as React from "react"

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

/* The header that opens a channel, shown above its very first message. */
const ChannelWelcome = React.forwardRef<
  HTMLElement,
  React.ComponentProps<"section">
>(({ className, ...props }, ref) => (
  <section ref={ref} className={cn("px-4 pb-2 pt-10", className)} {...props} />
))
ChannelWelcome.displayName = "ChannelWelcome"

const ChannelWelcomeIcon = React.forwardRef<
  HTMLDivElement,
  React.ComponentProps<"div">
>(({ className, children = "#", ...props }, ref) => (
  <div
    ref={ref}
    aria-hidden="true"
    className={cn(
      "mb-4 flex h-[68px] w-[68px] items-center justify-center rounded-full bg-newt-bg-elevated text-[32px] font-bold leading-none text-newt-text-primary",
      className
    )}
    {...props}
  >
    {children}
  </div>
))
ChannelWelcomeIcon.displayName = "ChannelWelcomeIcon"

const ChannelWelcomeTitle = React.forwardRef<
  HTMLHeadingElement,
  React.ComponentProps<"h2">
>(({ className, ...props }, ref) => (
  <h2
    ref={ref}
    className={cn(
      "text-[28px] font-bold leading-tight text-newt-text-primary",
      className
    )}
    {...props}
  />
))
ChannelWelcomeTitle.displayName = "ChannelWelcomeTitle"

const ChannelWelcomeDescription = React.forwardRef<
  HTMLParagraphElement,
  React.ComponentProps<"p">
>(({ className, ...props }, ref) => (
  <p
    ref={ref}
    className={cn("mt-2 text-base text-newt-text-muted", className)}
    {...props}
  />
))
ChannelWelcomeDescription.displayName = "ChannelWelcomeDescription"

export interface ChannelWelcomeActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
  /**
   * The element or component to render. Defaults to `button`, or to `a` when
   * `href` is set; pass a router link component to keep client navigation.
   * `span` renders the decorative form: hidden from assistive technology, out
   * of the tab order, with no pointer and no hover.
   * Its event handlers do not run.
   */
  as?: React.ElementType
  /** Render a link to this URL. */
  href?: string
  /**
   * Turns the control off. A link loses its URL, which takes it out of the
   * tab order, and says so with `aria-disabled`.
   */
  disabled?: boolean
  /** Link target, with `href`. */
  target?: React.AnchorHTMLAttributes<HTMLAnchorElement>["target"]
  /** Link relationship, with `href`. */
  rel?: string
}

/*
 * The `span` form runs nothing: it drops every event handler, so a click
 * cannot start an action that the keyboard and assistive technology miss.
 */
function withoutHandlers(
  props: React.HTMLAttributes<HTMLElement>
): React.HTMLAttributes<HTMLElement> {
  return Object.fromEntries(
    Object.entries(props).filter(([name]) => !/^on[A-Z]/.test(name))
  )
}

const ChannelWelcomeAction = React.forwardRef<
  HTMLElement,
  ChannelWelcomeActionProps
>(({ as, href, disabled, className, type = "button", ...props }, ref) => {
  const Tag: React.ElementType = as ?? (href === undefined ? "button" : "a")
  const isButton = Tag === "button"
  const decorative = Tag === "span"
  return (
    <Tag
      ref={ref}
      type={isButton ? type : undefined}
      href={decorative || disabled ? undefined : href}
      disabled={isButton ? disabled : undefined}
      aria-disabled={!isButton && !decorative && disabled ? true : undefined}
      aria-hidden={decorative ? true : undefined}
      className={cn(
        "mt-3 inline-flex items-center gap-2 rounded-[var(--newt-radius-sm)] border-0 bg-newt-bg-elevated px-4 py-1.5 text-sm font-medium text-newt-text-primary no-underline",
        !decorative &&
          "cursor-pointer transition-colors duration-fast ease-newt hover:bg-newt-bg-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-newt-text-link disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50",
        className
      )}
      {...(decorative ? withoutHandlers(props) : props)}
    />
  )
})
ChannelWelcomeAction.displayName = "ChannelWelcomeAction"

export interface ChannelWelcomeDateProps extends Omit<
  React.ComponentProps<"div">,
  "children"
> {
  /** Machine-readable date for the rendered `<time>` element. */
  dateTime?: string
  children?: React.ReactNode
}

/* Creation date, centred between two hairlines. */
const ChannelWelcomeDate = React.forwardRef<
  HTMLDivElement,
  ChannelWelcomeDateProps
>(({ className, dateTime, children, ...props }, ref) => (
  <div
    ref={ref}
    className={cn(
      "mt-6 grid grid-cols-[1fr_auto_1fr] items-center gap-2 text-[12px] font-semibold uppercase tracking-wide text-newt-text-muted",
      "[&>span]:h-px [&>span]:bg-newt-border",
      className
    )}
    {...props}
  >
    <span aria-hidden="true" />
    <time dateTime={dateTime}>{children}</time>
    <span aria-hidden="true" />
  </div>
))
ChannelWelcomeDate.displayName = "ChannelWelcomeDate"

export {
  ChannelWelcome,
  ChannelWelcomeIcon,
  ChannelWelcomeTitle,
  ChannelWelcomeDescription,
  ChannelWelcomeAction,
  ChannelWelcomeDate,
}
<script setup lang="ts">
import type { HTMLAttributes } from "vue"

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

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

<template>
  <section :class="cn('px-4 pb-2 pt-10', props.class)">
    <slot />
  </section>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from "vue"

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

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

<template>
  <div
    aria-hidden="true"
    :class="
      cn(
        'mb-4 flex h-[68px] w-[68px] items-center justify-center rounded-full bg-newt-bg-elevated text-[32px] font-bold leading-none text-newt-text-primary',
        props.class
      )
    "
  >
    <slot>#</slot>
  </div>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from "vue"

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

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

<template>
  <h2
    :class="
      cn(
        'text-[28px] font-bold leading-tight text-newt-text-primary',
        props.class
      )
    "
  >
    <slot />
  </h2>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from "vue"

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

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

<template>
  <p :class="cn('mt-2 text-base text-newt-text-muted', props.class)">
    <slot />
  </p>
</template>
<script setup lang="ts">
import type { Component, HTMLAttributes } from "vue"
import { computed } from "vue"

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

defineOptions({ inheritAttrs: false })

/*
 * The `span` form runs nothing: it drops every listener, so a click cannot
 * start an action that the keyboard and assistive technology miss.
 */
function withoutListeners(attrs: HTMLAttributes): HTMLAttributes {
  return Object.fromEntries(
    Object.entries(attrs).filter(([name]) => !/^on[A-Z]/.test(name))
  )
}

const props = defineProps<{
  /**
   * The element or component to render. Defaults to `button`, or to `a`
   * when `href` is set; pass `NuxtLink` or `RouterLink` to keep client
   * navigation. `span` renders the decorative form: hidden from assistive
   * technology, out of the tab order, with no pointer and no hover.
   * Its event handlers do not run.
   */
  as?: string | Component
  /** Render a link to this URL. */
  href?: string
  /**
   * Turns the control off. A link loses its URL, which takes it out of the
   * tab order, and says so with `aria-disabled`.
   */
  disabled?: boolean
  class?: HTMLAttributes["class"]
}>()

const tag = computed(
  () => props.as ?? (props.href === undefined ? "button" : "a")
)
const isButton = computed(() => tag.value === "button")
const decorative = computed(() => tag.value === "span")
</script>

<template>
  <component
    :is="tag"
    :type="isButton ? 'button' : undefined"
    :href="decorative || props.disabled ? undefined : props.href"
    :disabled="isButton ? props.disabled : undefined"
    :aria-disabled="
      !isButton && !decorative && props.disabled ? true : undefined
    "
    :aria-hidden="decorative ? true : undefined"
    :class="
      cn(
        'mt-3 inline-flex items-center gap-2 rounded-[var(--newt-radius-sm)] border-0 bg-newt-bg-elevated px-4 py-1.5 text-sm font-medium text-newt-text-primary no-underline',
        !decorative &&
          'cursor-pointer transition-colors duration-fast ease-newt hover:bg-newt-bg-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-newt-text-link disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50',
        props.class
      )
    "
    v-bind="decorative ? withoutListeners($attrs) : $attrs"
  >
    <slot />
  </component>
</template>
<script setup lang="ts">
import type { HTMLAttributes } from "vue"

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

const props = defineProps<{
  class?: HTMLAttributes["class"]
  /** Machine-readable date for the rendered `<time>` element. */
  dateTime?: string
}>()
</script>

<template>
  <!-- Creation date, centred between two hairlines. -->
  <div
    :class="
      cn(
        'mt-6 grid grid-cols-[1fr_auto_1fr] items-center gap-2 text-[12px] font-semibold uppercase tracking-wide text-newt-text-muted',
        '[&>span]:h-px [&>span]:bg-newt-border',
        props.class
      )
    "
  >
    <span aria-hidden="true" />
    <time :datetime="props.dateTime"><slot /></time>
    <span aria-hidden="true" />
  </div>
</template>
export { default as ChannelWelcome } from "./ChannelWelcome.vue"
export { default as ChannelWelcomeIcon } from "./ChannelWelcomeIcon.vue"
export { default as ChannelWelcomeTitle } from "./ChannelWelcomeTitle.vue"
export { default as ChannelWelcomeDescription } from "./ChannelWelcomeDescription.vue"
export { default as ChannelWelcomeAction } from "./ChannelWelcomeAction.vue"
export { default as ChannelWelcomeDate } from "./ChannelWelcomeDate.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 Channel Welcome 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 Channel Welcome 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 { ChannelWelcome } from "@/components/ui/channel-welcome"

export function Example() {
  return <ChannelWelcome />
}
<script setup lang="ts">
import { ChannelWelcome, ChannelWelcomeIcon, ChannelWelcomeTitle, ChannelWelcomeDescription, ChannelWelcomeAction, ChannelWelcomeDate } from "@/components/ui/channel-welcome"
</script>

<template>
  <ChannelWelcome />
</template>

ChannelWelcomeAction is a button. Pass href to make it a link, or pass a router link component to as.

A showcase or a read-only view draws the action and does nothing with it. Pass as="span" for that case. The action keeps its look and loses its pointer, its hover and its place in the tab order. It also takes aria-hidden, so assistive technology skips it.

API reference

ChannelWelcomeAction

PropType
as?string | Component

The element or component to render. Defaults to `button`, or to `a` when `href` is set. Pass a router link component to keep client navigation. `span` renders the decorative form, which runs no event handlers.

Typestring | Component
href?string | undefined

Render a link to this URL.

Typestring | undefined
disabled?boolean | undefined

Turns the control off. A link loses its URL, which takes it out of the tab order, and says so with `aria-disabled`. A disabled control fades to half opacity.

Typeboolean | undefined

ChannelWelcomeDate

PropType
dateTime?string | undefined

Machine-readable date for the rendered `<time>` element.

Typestring | undefined
children?React.ReactNode | undefined

Optional children value.

TypeReact.ReactNode | undefined

The registry exports ChannelWelcome, ChannelWelcomeIcon, ChannelWelcomeTitle, ChannelWelcomeDescription, ChannelWelcomeAction, ChannelWelcomeDate. 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.

Do not hide an interactive action with aria-hidden alone. It stays in the tab order, and a keyboard user lands on a control that a screen reader cannot announce. Use the decorative form.

Tokens

Channel Welcome 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-channel-welcome.

  • --newt-radius-full
  • --newt-bg-elevated
  • --newt-text-primary
  • --newt-text-muted
  • --newt-radius-sm
  • --newt-duration-fast
  • --newt-ease
  • --newt-bg-hover
  • --newt-text-link
  • --newt-border