百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

tabbed-card

> 前端框架
开源

一个用于 Home Assistant 的自定义卡,它利用标签来分隔各个卡片。

190 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个用于 Home Assistant 的自定义卡,它利用标签来分隔各个卡片。

Tabbed Card

A custom card for home assistant that utilizes tabs to segregate individual cards.

Installation

Use HACS or follow this guide

Card Schema

yaml
type: custom:tabbed-card
options?:
  defaultTabIndex?: number
styles?:
attributes?:
  label?: string
  icon?: string
  isFadingIndicator?: boolean
  minWidth?: boolean
  isMinWidthIndicator?: boolean
  stacked?: boolean
tabs:
  - card:
      type:
    styles?:
    attributes?:
      label?: string
      icon?: string
      isFadingIndicator?: boolean
      minWidth?: boolean
      isMinWidthIndicator?: boolean
      stacked?: boolean

Example

…

Configuration

You can apply global and per tab configuration to your card. Global configuration(top level properties) are expressed on all tabs in your card. You can also set local configuration, per tab styles and attributes that take precedence over any corresponding global configuration.

Options

Property Default Description
defaultTabIndex 0 tab to display on first render
yaml
type: custom:tabbed-card
options:
  defaultTabIndex: 1 # in a 0 based index, the second tab would be the active tab on render
tabs: ...

Styling

This card tries to closely match home assistants default tab styles. You can override and apply additional styling to the card via provided material web components custom properties.

Default Custom Properties:

Name Default Description
--mdc-theme-primary --primary-text-color Color of the activated tab's text, indicator, and ripple.
--mdc-tab-text-label-color-default rgba(225, 225, 225, 0.8) Color of an unactivated tab label. If you want transpareny on the unactivated tabs, you need to use an rgba value incorporating the 4th alpha channel.
--mdc-typography-button-font-size 14px Font size of the tab label.
yaml
type: custom:tabbed-card
styles: # global styles applied to all tabs
  --mdc-theme-primary: yellow
  --mdc-tab-text-label-color-default: orange
tabs: ...

See the full list of exposed custom properties: ``

Attributes

Name Default Description
label "" Text label to display in tab.
icon "" Home Assistant mdi:icon name.
isFadingIndicator false Indicator fades in and out instead of sliding.
minWidth false Shrinks tab as narrow as possible without causing text to wrap.
isMinWidthIndicator false Shrinks indicator to be the size of the content.
stacked false Stacks icon on top of label text.

Global attributes:

yaml
type: custom:tabbed-card
styles:
  ...
attributes:
  icon: mdi:fire # global attribute applied to all tabs
tabs:
  - attributes:
      label: Button
    card:
      type: button
      entity: light.bed_light
      tap_action:
        action: toggle
      show_name: true
      show_icon: true
      show_state: true
  ...

Local attributes:

…

Appreciation

Thanks for the support and services provided Home Assistant, HACS and lit Aslo, thanks to the swipe-card for inspiration and all of the other open source cards/projects as references.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptcardhacshacs-customhome-assistant

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架