Production credential
Read and write
nk_live_7P3F… was last used today at 08:31 UTC.
Contextual descriptions attached to an owned, focusable Button trigger.
app/components/nitro_kit/tooltip.rbNitroKit::Tooltip.new(id:, content:) { |tooltip| tooltip.trigger }CSS exposes each description on hover and focus; a tiny controller only adds Escape dismissal.
test/dummy/app/components/gallery/components/tooltip_page.rbNitroKit::Tooltip::PLACEMENTS.each do |placement|
sample(placement.to_s.humanize, slug: placement.to_s) do
render_tip(
"gallery-tooltip-#{placement}",
"This explanation opens on the #{placement} edge.",
placement:
)
end
endTooltip owns a real Button trigger, including icon-only accessible actions.
A contextual explanation composes beside a sensitive setting without wrapping a raw focus target.
nk_live_7P3F… was last used today at 08:31 UTC.
test/dummy/app/components/gallery/components/tooltip_page.rbrender NitroKit::Card.new(id: "gallery-tooltip-api-card") do |card|
card.title("Production credential", level: 3)
card.body do
render NitroKit::Badge.new(
"Read and write",
id: "gallery-tooltip-api-access",
color: :warning,
size: :sm
)
p { "nk_live_7P3F… was last used today at 08:31 UTC." }
end
card.footer do
render NitroKit::Tooltip.new(
id: "gallery-tooltip-rotate-key",
content: "Rotation immediately reveals a new secret once."
) do |tooltip|
tooltip.trigger("How rotation works")
end
render NitroKit::Button.new(
"Rotate credential",
id: "gallery-tooltip-rotate-action",
variant: :destructive
)
end
end