MCPcopy Index your code
hub / github.com/custom-cards/button-card

github.com/custom-cards/button-card @v7.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v7.0.1 ↗ · + Follow
322 symbols 609 edges 29 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Button Card by @RomRider

Stable Beta HACS Badge Project Maintenance

Downloads [GitHub Activity]commits License Discord Community Forum

Useful links

What is custom:button-card?

This is a lovelace custom card called button-card for your entities with a LOT of configuration options.

all

  • works with any entity
  • 6 available actions on tap and/or hold and/or double click: none, toggle, more-info, navigate, url, assist and call-service
  • icon tap action: Separate action when clicking the icon specifically which takes precedence over main card actions.
  • momentary actions for the card and/or icon: press_action and release_action (if used, replaces default actions)
  • 3 button-card custom actions: javascript, multi-actions, toast
  • state display (optional)
  • custom color (optional), or based on light rgb value/temperature
  • custom state definition with customizable color, icon and style
  • custom size of the icon, width and height
  • aspect ratio support
  • Support for javascript templates
  • custom icon
  • custom css style
  • multiple layout support and custom layout support
  • units for sensors can be redefined or hidden
  • 2 color types
  • icon : apply color settings to the icon only
  • card : apply color settings to the card only
  • automatic font color if color_type is set to card
  • blank card and label card (for organization)
  • Native blink animation support
  • icon rotation animation support
  • confirmation popup for sensitive items or locking mecanism
  • password or PIN protection for actions
  • haptic support for the IOS companion App
  • support for HACS

Extension points exported contracts — how you extend this code

ActionHandlerType (Interface)
(no doc) [1 implementers]
src/action-handler.ts
LovelaceCard (Interface)
(no doc) [1 implementers]
src/types/lovelace.ts
HASSDomEvents (Interface)
(no doc)
src/forward-haptic.ts
GroupEntityAttributes (Interface)
(no doc)
src/helpers.ts
HASSDomEvents (Interface)
(no doc)
src/handle-action.ts
HASSDomEvents (Interface)
(no doc)
src/button-card.ts
UpdateEntityAttributes (Interface)
(no doc)
src/common/update.ts
ActionHandlerDetail (Interface)
(no doc)
src/action-handler.ts

Core symbols most depended-on inside this repo

_getTemplateOrValue
called by 57
src/button-card.ts
_isActionDoingSomething
called by 29
src/button-card.ts
_objectEvalTemplate
called by 17
src/button-card.ts
bind
called by 15
src/action-handler.ts
computeDomain
called by 14
src/helpers.ts
fireEvent
called by 13
src/common/fire-event.ts
_buildStyleGeneric
called by 12
src/button-card.ts
parseDuration
called by 7
src/common/parse-duration.ts

Shape

Interface 118
Method 101
Function 87
Enum 10
Class 6

Languages

TypeScript100%

Modules by API surface

src/button-card.ts85 symbols
src/types/types.ts43 symbols
src/types/lovelace.ts40 symbols
src/types/homeassistant.ts36 symbols
src/helpers.ts34 symbols
src/action-handler.ts18 symbols
src/common/format_date.ts9 symbols
src/common/format_number.ts8 symbols
src/common/update.ts7 symbols
src/types/translation.ts6 symbols
src/common/format_date_time.ts5 symbols
src/common/state_color.ts4 symbols

For agents

$ claude mcp add button-card \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact