Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Global Navigation

  • Navbar
  • BeianFooter
  • Brand
  • AppLauncher
  • Sidebar
  • NavMenu
  • NavigationMenu
  • Menu
  • Menubar
  • Dock
  • BubbleMenu
  • CardNav
  • FlowingMenu
  • GooeyNav
  • PillNav
  • StaggeredMenu

In-page Navigation

  • RouteTabs
  • Tabs
  • Breadcrumb
  • Pagination
  • Anchor
  • Affix
  • BackTop
  • Stepper
  • Steps
  • PageHeader

Actions and Tools

  • Command
  • ContextMenu
  • Toolbar
  • Accordion
  • Collapsible
  • Link
  • AnimatedThemeToggler

Brand

brand

Combines a square brand mark, name, and optional description with collapsed and router-link modes.

Usage

Basic usage

Square corner badge + site name. If mark is not passed, the first letter of the brand name (one Chinese character/English initial letter) will be automatically taken.

HHulian BackstageHhulian admin
tsx
<Brand name="Hulian Backstage" />
<Brand name="hulian admin" />

Custom badge · Subtitle · Color

mark connects to the icon/picture; description hangs a row of version or positioning; color changes the badge background color.

Hulianv0.18.0DData PlatformInternal system
tsx
<Brand mark={<Logo />} name="Hulian" description="v0.18.0" />
<Brand name="Data Platform" color="chart-3" description="Internal System" />

Three sizes · Collapsed state

sm Navigation bar / md Side bar / lg Login page brand area; omit name to only display the badge (used when the side bar is collapsed).

HHulianHHulianHHulian
tsx
<Brand size="sm" name="Hulian" />
<Brand size="md" name="Hulian" />
<Brand size="lg" name="Hulian" />
<Brand mark={<Logo />} /> {/* Collapse */}

Animated badge

Drop a GIF / APNG / animated WebP into mark and it plays; wrap it in <picture> to give users with reduced motion enabled a static image. Both forms fill the badge.

Hulian Backstagepicture reduced-motion fallbackHulian Backstage
tsx
// Pass the animation as an img; <picture> gives reduced-motion users a static fallback
<Brand
  name="Hulian Admin"
  mark={
    <picture>
      <source srcSet="/brand-static.png" media="(prefers-reduced-motion: reduce)" />
      <img src="/brand-motion.gif" alt="" />
    </picture>
  }
/>
<Brand mark={<img src="/brand-motion.gif" alt="Hulian Admin" />} />   {/* Collapsed */}

Link back to home page

href uses ordinary links; render connects to frame routing components (react-router / next/link) to avoid SPA full page refresh.

HHulianHulianClick me to return to the home page
tsx
<Brand name="Hulian" href="/" />
<Brand name="Hulian" render={<Link to="/" />} />

Bare logo, filled by shape

variant="bare" drops the badge, and maskSrc fills a single-color logo image with the brand color by its shape, following the theme color and AccentScope.

Hulian UIHulian UIA logo inside the badge
tsx
<Brand variant="bare" maskSrc="/logo.svg" name="Hulian UI" />
<Brand variant="bare" maskSrc="/logo.svg" name="Hulian UI" color="chart-4" />

When to use

Use Brand for the common square badge and site-name lockup found in the upper-left of a navigation bar, at the top of a sidebar, in a footer brand column, or on an authentication page.

Avatar is not a substitute: Avatar is circular and its sizes describe a circular diameter, while a brand badge needs squared corners and token-based rounding. Changing Avatar's shape through className would be a consumer-side patch (hulianui/hulian#57).

Import

ts
import { Brand } from "@hulianui/ui"

Props

NameTypeDefaultDescription
markReactNodeFirst character of nameBadge content such as an icon, image, animated image, video, or initial.
nameReactNode-Brand name. Omit it to render only the badge in a collapsed sidebar.
descriptionReactNode-One-line subtitle below the brand name, such as a version or positioning statement.
size"sm" | "md" | "lg""md"sm is a 28px navigation badge, md is a 36px sidebar badge, and lg is for authentication-page branding.
colorstring"primary"Badge background. Accepts a semantic tone such as chart-3 or any CSS color. With variant="bare" it colors the mark itself.
variant"badge" | "bare""badge"badge is a square filled badge with the mark inside; bare drops the badge so the mark is the logo itself, colored with color.
maskSrcstring-URL of a single-color logo image. The image's shape is filled with color (CSS mask), so the logo follows the theme color and AccentScope. Overrides mark when set.
hrefstring-Native link target, normally the home page.
renderReactElement-Renders through a framework router element such as <Link to="/" />, following the Button, Link, and NavMenuItem render contract.
classNamestring-Class name for the root; remaining native attributes are forwarded.

Example

tsx
// Navigation bar
<Brand size="sm" mark={<Logo />} name="Hulian Admin" render={<Link to="/" />} />

// Sidebar: retain only the badge when collapsed
<Brand mark={<Logo />} name={collapsed ? undefined : "Hulian Admin"} />

// Authentication page
<Brand size="lg" name="Hulian Admin" description="v0.18.0" />

// Animated brand (GIF / APNG / animated WebP): pass it as an img and it plays;
// wrap it in <picture> to give users with reduced motion enabled a static fallback
<Brand
  name="Hulian Admin"
  mark={
    <picture>
      <source srcSet="/brand-static.png" media="(prefers-reduced-motion: reduce)" />
      <img src="/brand-motion.gif" alt="" />
    </picture>
  }
/>

// Video brand: muted autoplay loop plus a poster. <video> has no native reduced-motion
// fallback, so decide autoplay with the exported usePrefersReducedMotion (it rests on the poster otherwise)
const reduced = usePrefersReducedMotion();
<Brand
  name="Hulian Admin"
  mark={<video src="/brand.webm" poster="/brand-static.png" autoPlay={!reduced} muted loop playsInline />}
/>

// A single-color logo with its own shape: no badge, filled with the brand color, follows the theme color / AccentScope
<Brand variant="bare" maskSrc="/logo.svg" name="Hulian UI" render={<Link href="/" />} />

Usage guidelines

  • When name is present, the badge is decorative and receives aria-hidden; the name supplies the accessible identity. In a mark-only collapsed state, make mark meaningful or provide an aria-label on the root.
  • The badge uses --color-primary-foreground over its background. Check contrast when supplying a custom mid-luminance color.
  • Pass brand images, animated images, and video through mark={<img ... />}, <picture>, <video>, or <canvas>. The component already fills the badge and applies object-cover, so do not add another size wrapper. Self-drawn animations that render a <div> (Lottie and similar) are outside this rule; give the container className="size-full".
  • Animated marks need a reduced-motion fallback. For image formats wrap them in <picture> with <source media="(prefers-reduced-motion: reduce)">; the browser switches natively with no JavaScript (Chrome picks the source at page load; changing the OS preference mid-session is not guaranteed to re-select until a reload). <video> can only be handled by toggling autoPlay with usePrefersReducedMotion; CSS cannot pause it.
  • The badge is square, so non-square assets are cropped by object-cover. Export a square version of an animated logo. GIF's 1-bit transparency exposes the badge background (color) along the edges, so prefer APNG or animated WebP for transparent edges, or export an opaque version.

Related

Avatar · Navbar · NavMenu · AdminLayout · BeianFooter · LoginForm

Playground

HHulian Backstage
<Brand
  name="Hulian Backstage"
/>
PreviousBeianFooterNavigationNextAppLauncher

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Example
    • Usage guidelines
    • Related
  • Playground