Skip to content

可及性 ​

無障礙輔助元件。

INFO

所有元件都能用共用方法(key、visible、class、attributes、view…)。

skip-link

「跳到主要內容」連結,只在鍵盤聚焦時出現。

php
use Cg\ComponentFramework\Component\SkipLink\SkipLink;

SkipLink::make('#main');

建構:SkipLink::make(string $target, Htmlable|Closure|string $label = '跳至主要內容')

可用選項

  • position():start · center · end
方法一覽 (3)
  • target(string $target)
  • label(Htmlable|Closure|string $label)
  • position(string $position)

VisuallyHidden ​

visually-hidden

畫面上隱藏、但螢幕閱讀器讀得到的文字。

php
use Cg\ComponentFramework\Component\VisuallyHidden\VisuallyHidden;

VisuallyHidden::make('開啟主選單');

建構:VisuallyHidden::make(Htmlable|Closure|string $content)

可用選項

  • as():span · div · p
方法一覽 (2)
  • as(string $tag)
  • focusable(bool $condition = true)

這一頁由 scripts/wiki-components/generate.php 依原始碼產生,範例都經過實際渲染驗證。