Skip to content
Brok UI

Loading…

No results

Logo Chip

Open source

A small chip that names a source, company or platform: a leading brand icon, favicon or monogram beside a truncating name, static or as a link, in sm and md.

Version
v1.0.0
Stability
stable
License
MIT
Related
Brand Icon
Avatar
Badge
User Identity

Preview

YouTube Instagram Brok UI Northwind Traders
Size
previews.components.logo-chip.default.blade.php Blade
<div class="flex flex-wrap items-center gap-2">
    <x-ui.logo-chip name="YouTube" platform="youtube" />
    <x-ui.logo-chip name="Instagram" platform="instagram" tone="brand" />
    <x-ui.logo-chip name="Brok UI" src="/favicon-96x96.png" />
    <x-ui.logo-chip name="Northwind Traders" />
</div>
Sm Current
Md Current

Installation

terminal
php artisan ui:add logo-chip

Registry contract

php artisan ui:add logo-chip writes only the files below. The CLI validates each file hash before writing and asks before it replaces a local change, unless you pass --force.

  • blade resources/views/components/ui/logo-chip.blade.php
Registry dependencies
brand-icon avatar
Packages
composer: jml/brok:^0.2

Use with AI

A brief for your coding agent: install command, usage, props, guidance and the rules. Copy it, or open a prompt about this component in an assistant.

logo-chip.md
# Brok UI: Logo Chip (`logo-chip`)

A small chip that names a source, company or platform: a leading brand icon, favicon or monogram beside a truncating name, static or as a link, in sm and md.

Brok UI is a Laravel Blade component registry. Installed components are plain Blade files the app owns.

## Install

```bash
php artisan ui:add logo-chip
```

## Usage

```blade
<div class="flex flex-wrap items-center gap-2">
    <x-ui.logo-chip name="YouTube" platform="youtube" />
    <x-ui.logo-chip name="Instagram" platform="instagram" tone="brand" />
    <x-ui.logo-chip name="Brok UI" src="/favicon-96x96.png" />
    <x-ui.logo-chip name="Northwind Traders" />
</div>
```

## Props

- `name` (string, default ``) — Visible name of the source. It truncates with an ellipsis and repeats in a title attribute. Empty falls back to the default slot.
- `platform` (x|youtube|instagram|tiktok|linkedin|pinterest|vimeo|null, default `null`) — Leading brand-icon for a known platform (twitter is an alias of x). An unknown platform falls back to src or the monogram.
- `src` (string|null, default `null`) — Image or favicon URL for the mark when no platform is set. A failed load shows the name's monogram, without JavaScript.
- `href` (string|null, default `null`) — Renders the chip as a link with hover and focus ring. Extra attributes (target, rel) pass through to the root.
- `size` (md|sm, default `md`) — sm is 24px high with a 16px mark and text-xs; md is 32px high with a 20px mark and text-sm.
- `tone` (current|brand, default `current`) — Forwarded to brand-icon: currentColor or the platform colour.
- `kind` (company|person, default `company`) — Shape of the image or monogram mark: company is a rounded square, person a circle.

## Use when

- Use to summarize, sequence, or present data so users can scan it quickly.
- Showing where an item comes from (a platform, a publisher, a company) as a compact mark and name in a row, card or list.
- Linking to that source or to a filter for it while keeping the mark and name together.

## Avoid when

- Do not add display-only ornament when the user needs actionable structure or exact comparison instead.
- A status, count or category without an identity mark; use badge.
- Only the mark, without a name; use avatar or brand-icon.
- A person with a secondary line or a role; use user-identity.

## Anti-patterns

- Adding display ornament without informational value

## Rules

- Use the `<brok:logo-chip>` tag (or `<x-ui.logo-chip>`) in Blade; do not rewrite the component.
- Prefer the documented props and variants over utility-class overrides; when a utility must win, use the `!` important modifier.
- Use semantic design tokens (`bg-primary`, `text-muted-foreground`), never raw colour utilities.
- Keep the `data-slot` attributes; they are the styling and test hooks.

## Links

- Docs: https://brokui.dev/docs/components/logo-chip
- Registry JSON (files, props, contract): https://brokui.dev/r/open/logo-chip.json

Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.

Examples

fallbacks.blade.php Blade
<div class="flex flex-wrap items-center gap-2">
    <x-ui.logo-chip name="Missing Logo Ltd" src="/images/missing-logo.png" data-test="broken" />
    <x-ui.logo-chip name="Unknown Platform" platform="myspace" data-test="unknown-platform" />
    <x-ui.logo-chip name="Northwind Traders" data-test="monogram" />
</div>
long-content.blade.php Blade
<div class="flex w-48 flex-col items-start gap-2">
    <x-ui.logo-chip name="The International Consolidated Airlines Group Newsroom" src="/favicon-96x96.png" />
    <x-ui.logo-chip name="An extraordinarily long channel name on YouTube" platform="youtube" href="#" />
    <x-ui.logo-chip size="sm" name="Pinterest board with a very long descriptive title" platform="pinterest" />
</div>
sizes.blade.php Blade
<div class="flex flex-col items-start gap-3">
    @foreach (['sm', 'md'] as $size)
        <div class="flex flex-wrap items-center gap-2">
            <x-ui.logo-chip :size="$size" name="X" platform="x" />
            <x-ui.logo-chip :size="$size" name="Vimeo" platform="vimeo" tone="brand" />
            <x-ui.logo-chip :size="$size" name="Brok UI" src="/favicon-96x96.png" />
            <x-ui.logo-chip :size="$size" name="Ava Chen" kind="person" />
        </div>
    @endforeach
</div>

API

manifest knowledge + registry-derived coverage

Props

Props accepted by this component: name, type, default value and description.
Prop Type Default Description
name string Visible name of the source. It truncates with an ellipsis and repeats in a title attribute. Empty falls back to the default slot.
platform x | youtube | instagram | tiktok | linkedin | pinterest | vimeo | null null Leading brand-icon for a known platform (twitter is an alias of x). An unknown platform falls back to src or the monogram.
src string | null null Image or favicon URL for the mark when no platform is set. A failed load shows the name's monogram, without JavaScript.
href string | null null Renders the chip as a link with hover and focus ring. Extra attributes (target, rel) pass through to the root.
size md | sm md sm is 24px high with a 16px mark and text-xs; md is 32px high with a 20px mark and text-sm.
tone current | brand current Forwarded to brand-icon: currentColor or the platform colour.
kind company | person company Shape of the image or monogram mark: company is a rounded square, person a circle.

Slots

  • default — Label content used only when name is empty.

Data slots

Stable hooks for CSS overrides and browser tests.

logo-chip logo-chip-label

Behavior

  • Pure Blade, no JavaScript. The mark order is platform brand-icon, then the src image, then the monogram derived from name.
  • The mark is decorative because the name is visible text; the link's accessible name is the name.
  • Uses logical padding and a flex row, so the mark leads on the start side in RTL; marks do not mirror.
  • Declares registry capability flags: a11y, authoredStateFixtures, responsive, rtl, darkMode, localized.

Guidance

Scannable data display

Present data for rapid scanning.

Use when

  • Use to summarize, sequence, or present data so users can scan it quickly.
  • Showing where an item comes from (a platform, a publisher, a company) as a compact mark and name in a row, card or list.
  • Linking to that source or to a filter for it while keeping the mark and name together.

Avoid when

  • Do not add display-only ornament when the user needs actionable structure or exact comparison instead.
  • A status, count or category without an identity mark; use badge.
  • Only the mark, without a name; use avatar or brand-icon.
  • A person with a secondary line or a role; use user-identity.

Use instead

  • Table for exact comparison
  • Plain text for a single value

Anti-patterns

  • Adding display ornament without informational value
Anatomy
root (span, or a when href is set) mark (brand-icon, or avatar with image or monogram) label
Theming hooks
logo-chip recipe in _styles.php (base, link, label, sizes) border-border, bg-background, hover:bg-muted, text-foreground

Accessibility

WCAG 2.2 AA Keyboard focus-visible RTL-ready Localized labels Dark mode
Keyboard
No component-owned keyboard interaction; native element behavior applies.
Focus
none
  • The visible name is the accessible name; the mark carries aria-hidden.
  • A link chip shows the shared focus ring; sm is 24px and md 32px high, which meets the 24px target minimum (WCAG 2.5.8). Use md where the chip is a primary touch target.
  • Long names truncate on one line; the full name stays in the DOM and in the title attribute.
  • Semantic HTML and a stable data-slot attribute for styling and scripting hooks.
  • Focus-visible rings use the ring token, so keyboard focus is always visible.
  • Disabled and invalid states are conveyed to assistive tech, not by color alone.
  • Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces in the preview.
  • Labels go through __() and layout uses logical properties (ms-*, text-start), so it mirrors under dir="rtl" — flip the preview to RTL to confirm.
  • Dark mode uses the same semantic tokens under the dark class; high contrast follows forced-color system tokens.

Livewire

Safe

Livewire can update this component through forwarded wire:* attributes.

Source

The exact, editable file ui:add writes into your app. Previews render this same code; there are no preview-only components.

resources/views/components/ui/logo-chip.blade.php Blade
@props([
    'name' => '',
    'platform' => null,
    'src' => null,
    'href' => null,
    'size' => 'md',
    'tone' => 'current',
    'kind' => 'company',
])

@php
    $styles = require base_path(config('ui.component_path', 'resources/views/components/ui').'/_styles.php');
    $recipe = $styles['logo-chip'];
    $size = isset($recipe['sizes'][$size]) ? $size : 'md';
    $sizing = $recipe['sizes'][$size];

    // Keep in step with the marks brand-icon draws; an unknown platform falls
    // back to the image or the monogram.
    $platforms = ['x', 'twitter', 'youtube', 'instagram', 'tiktok', 'linkedin', 'pinterest', 'vimeo'];
    $platformKey = mb_strtolower(trim((string) $platform));
    $hasPlatform = in_array($platformKey, $platforms, true);

    $name = trim((string) $name);
    $tag = filled($href) ? 'a' : 'span';
    $classes = trim($recipe['base'].' '.$sizing['root'].($tag === 'a' ? ' '.$recipe['link'] : ''));
@endphp

<{{ $tag }}
    data-slot="logo-chip"
    data-size="{{ $size }}"
    @if ($hasPlatform) data-platform="{{ $platformKey }}" @endif
    @if ($tag === 'a') href="{{ $href }}" @endif
    {{ $attributes->merge(['class' => $classes]) }}
>
    @if ($hasPlatform)
        <x-ui.brand-icon :name="$platformKey" :size="$sizing['icon']" :tone="$tone" />
    @elseif (filled($src) || $name !== '')
        <x-ui.avatar
            :src="$src"
            :name="$name !== '' ? $name : null"
            :kind="$kind === 'person' ? 'person' : 'company'"
            size="xs"
            decorative
            class="{{ $sizing['avatar'] }}"
        />
    @endif
    <span data-slot="logo-chip-label" class="{{ $recipe['label'] }}" @if ($name !== '') title="{{ $name }}" @endif>{{ $name !== '' ? $name : $slot }}</span>
</{{ $tag }}>

Ownership & lifecycle

Owner, release state, review evidence and adoption for this item.
Owner
Platform UI (@JoshJML)
Current version
1.0.0
Status
Stable
License
open
Accessibility reviewed
No review date recorded
Last breaking change
No date recorded
Deprecation
Not deprecated
Contract
v6
Foundation
≥ 1.0.0