Skip to content

Component Classes ​

The 61 public top-level components in the Catalog, A–Z. Each entry lists its own methods; methods inherited from Component/Action/Field are collapsed.

TIP

For copy-paste examples, see Components. This page is the full signature dictionary.

Accordion ​

class

Cg\ComponentFramework\Component\Accordion\Accordion

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:accordion · Category:Data · Usage & example → · View:cg-component::Accordion.AccordionView

MethodReturns
getItems()NodeCollection
items(iterable $items)static
label(?string $label)static
static make(iterable $items = [])static
push(AccordionItem $item)static
single(bool $condition = true)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Alert ​

class

Cg\ComponentFramework\Component\Alert\Alert

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:alert · Category:Feedback · Usage & example → · View:cg-component::Alert.AlertView

MethodReturns
actions(Actions|Traversable|array $actions)static
danger()static
dismissible(bool $condition = true, string $label = '關閉通知')static
icon(Icon|string|null $icon)static
info()static
static make(Htmlable|Closure|string $message)static
message(Htmlable|Closure|string $message)static
success()static
title(Htmlable|Closure|string|null $title)static
type(NotifyType|string $type)static
visibilityState(string $key)static
warning()static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Avatar ​

class

Cg\ComponentFramework\Component\Avatar\Avatar

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:avatar · Category:Content & Media · Usage & example → · View:cg-component::Avatar.AvatarView

Constants (allowed values)

  • SHAPES:circle · rounded · square
  • SIZES:xs · sm · md · lg · xl · 2xl
  • STATUSES:online · offline · away · busy
MethodReturns
decorative(bool $condition = true)static
eager(bool $condition = true)static
initials(Closure|string|null $initials)static
static make(Closure|string $name, Closure|string|null $source = null)static
shape(string $shape)static
size(string $size)static
source(Closure|string|null $source)static
status(?string $status)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Badge ​

class

Cg\ComponentFramework\Component\Badge\Badge

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:badge · Category:Primitives · Usage & example → · View:cg-component::Badge.BadgeView

Constants (allowed values)

  • COLORS:neutral · primary · success · warning · danger · info
  • SIZES:sm · md · lg
MethodReturns
color(string $color)static
icon(Icon|string|null $icon)static
static make(Htmlable|Closure|string $label)static
rounded(bool $condition = true)static
size(string $size)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

class

Cg\ComponentFramework\Component\Breadcrumbs\Breadcrumbs

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:breadcrumbs · Category:Navigation · Usage & example → · View:cg-component::Breadcrumbs.BreadcrumbsView

MethodReturns
items(iterable $items)static
label(string $label)static
static make(iterable $items = [])static
push(BreadcrumbItem $item)static
separator(Htmlable|string $separator)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Button ​

class

Cg\ComponentFramework\Component\Button\Button

Extends:Action → Component → Node · Implements:ActionComponent、RenderableNode、Htmlable · Catalog ID:button · Category:Actions · Usage & example → · View:cg-component::Button.ButtonView

Constants (allowed values)

  • TYPES:button · submit · reset
  • COLORS:neutral · primary · success · warning · danger · info
  • SIZES:sm · md · lg
  • VARIANTS:solid · outline · ghost
MethodReturns
static make(Htmlable|Closure|string $label)static
name(?string $name)static
type(string $type)static
value(string|int|float|bool|null $value)static
Inherited methods (34)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Action:closesModal color disabled icon iconOnly linkerCall opensModal size stateSet stateToggle variant

ButtonGroup ​

class

Cg\ComponentFramework\Component\ButtonGroup\ButtonGroup

Extends:Component → Node · Implements:Htmlable、RenderableNode、ActionComponent · Catalog ID:button-group · Category:Actions · Usage & example → · View:cg-component::ButtonGroup.ButtonGroupView

Constants (allowed values)

  • ORIENTATIONS:horizontal · vertical
MethodReturns
actions(iterable $actions)static
attached(bool $condition = true)static
getActions()NodeCollection
label(?string $label)static
static make(iterable $actions = [])static
orientation(string $orientation)static
push(ActionComponent $action)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Callout ​

class

Cg\ComponentFramework\Component\Callout\Callout

Extends:Alert → Component → Node · Implements:Htmlable、RenderableNode · Catalog ID:callout · Category:Feedback · Usage & example → · View:cg-component::Callout.CalloutView

MethodReturns
static make(Htmlable|Closure|string $message)static
Inherited methods (34)

from Alert:actions danger dismissible icon info message success title type visibilityState warning

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Card ​

class

Cg\ComponentFramework\Component\Card\Card

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:card · Category:Content & Media · Usage & example → · View:cg-component::Card.CardView

Constants (allowed values)

  • COLORS:default · primary · success · warning · danger · info
MethodReturnsNotes
actions(Actions|Traversable|array $actions)static
body(mixed $content)static
collapsible(bool $condition = true, bool $collapsed = false)static純客戶端展開/收合,不發 request。
color(string $color)static
description(Htmlable|Closure|string|null $description)static
getActions()Actions
getBody()NodeCollection
getDescription()Htmlable|string|null
getImage()?string
getTitle()Htmlable|string|null
getUrl()?string
headingLevel(int $level)static
image(?string $image)static
isCollapsed()bool
isCollapseServerControlled()bool
isCollapsible()bool
static isSafeUrl(?string $url)bool
static make(Htmlable|Closure|string|null $title = null)static
schema(Schema $schema)static
serverCollapsible(bool $collapsed = false)static用 CardLinker 保存展開狀態;只有需要伺服器 guard 時才使用。
title(Htmlable|Closure|string|null $title)static
url(?string $url)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

class

Cg\ComponentFramework\Component\Carousel\Carousel

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:carousel · Category:Content & Media · Usage & example → · View:cg-component::Carousel.CarouselView

Constants (allowed values)

  • ASPECTS:auto · video · square · portrait
  • EFFECTS:slide · fade
MethodReturns
active(?string $key)static
aspect(string $aspect)static
autoplay(int $seconds = 5)static
controls(bool $condition = true)static
effect(string $effect)static
indicators(bool $condition = true)static
label(string $label)static
loop(bool $condition = true)static
static make(iterable $slides = [])static
push(CarouselSlide $slide)static
slides(iterable $slides)static
stateKey(string $key)static
withoutAutoplay()static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Chart ​

class

Cg\ComponentFramework\Component\Chart\Chart

圖表元件。繪圖由「驅動」負責(預設 amCharts 5,內建 Chart.js,可自行擴充;見 ChartDriver)。

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:chart · Category:Data · Usage & example → · View:cg-component::Chart.ChartView

Constants (allowed values)

  • TYPES:line · area · step · column · bar · scatter · pie · donut · gantt · raw
  • CURSORS:none · cross · horizontal · vertical · segment · multi
  • THEMES:animated · dark · responsive · micro · kelly · moonrise · spirited · frozen · dataviz
  • EXPORT_FORMATS:png · jpg · svg · pdf · csv · json · xlsx · print · html
  • RANGES:1D · 1W · 1M · 3M · 6M · 1Y · YTD · all
  • TIME_UNITS:millisecond · second · minute · hour · day · week · month · year
  • DURATION_UNITS:year · month · week · day · hour · minute · second
MethodReturnsNotes
amchart(array $settings)static【amCharts 專屬】原生設定合併:key 為 chart/xAxis/yAxis/yAxis2/cursor/legend/series.{key}, 值就是 amCharts .new(root, { … }) 的 settings。Color/Percent 用 {"type":"Color","value":"#f00"}。 等同 driverOptions('amcharts', ['merge' => …])。
area()static
static assertColor(string $color, string $what)string
axis(int $axis, ?string $title = null, int|float|null $min = null, int|float|null $max = null, ?string $format = null, bool $logarithmic = false)staticY1/Y2 軸:標題、範圍、數字格式(amCharts 格式字串,例如 "#,###.0")。
axisTooltips(bool $x = true, bool $y = true)static【amCharts 專屬】游標在水平軸(x)/垂直軸(y)上的值標籤,各自獨立。 全站預設見 config('cg-components.chart.driver_options.amcharts')。
bar()static
categoryField(string $field)static
column()static
cursor(string $mode)staticnone|cross|horizontal|vertical|segment(區段比對面板)|multi(多點指標+區段比對)
cursorWhenEmpty(bool $show = true)static沒有資料時是否仍顯示游標。預設 false:沒資料的圖游標只會出現 NaN 與空白指標,所以隱藏。
data(Traversable|Arrayable|Closure|array $rows)static資料列。接受陣列、Collection/Arrayable(含 Eloquent 集合)、任何 iterable, 或 Closure(渲染時才呼叫)。每列可以是陣列或物件/Model。
dateField(string $field, string $unit = 'day', int $count = 1)static以時間軸呈現。日期欄位的值可以是 Carbon/字串/毫秒時間戳,輸出時統一轉毫秒。
static definePreset(string $name, Closure $configure)void註冊命名預設,之後 ->preset('dashboard') 一行套用整組設定。
donut()static
driver(string $name)static選擇繪圖驅動(預設見 config cg-components.chart.driver)。 規格裡不支援的能力會在前端安全降級;要在伺服器端就擋下請用 requireSupport()。
driverName()string
driverOptions(string $driver, array $options)static驅動專屬選項(遞迴合併)。通用規格以外的東西都放這裡,例如 driverOptions('chartjs', ['merge' => ['options' => […]]])。
emptyText(string $text, ?string $hint = null)static沒有可畫資料時顯示的文字(預設「無資料」)。 資料來自 source() 時,第一次載入完成前不會顯示。
exportable(?array $formats = null, ?string $filename = null)static匯出:圖片(png/jpg/svg)、PDF、資料(csv/json/xlsx)、列印、 html=單檔互動 HTML(離線打開仍可 tooltip、縮放、切換序列;需要驅動支援 export:html)。
static flushMacros()—Flush the existing macros.
static flushPresets()void
font(string $family, ?string $pdfFont = null)static圖表字型,同時用於 PDF 匯出(需內嵌字型才能輸出中日韓文字)。
static gantt(string $name)static甘特圖入口:自動建立任務階層、進度、相依連線。
ganttOptions(array $options)static
static hasMacro($name)—Checks if macro is registered.
height(string $height)static
hook(string $name)static宣告前端註冊的擴充 hook 名稱(registerChartHook)。只能引用名稱, 不接受任何伺服器傳來的程式碼。
label(string $label)static
legend(bool $condition = true)static
legendValues(bool $show = true)static圖例跟著游標顯示該點每個序列的數值(數字格式依序列所在軸的 format)。 需要游標(cursor 不是 none);會一併開啟圖例。驅動不支援時只顯示名稱。
line()static
static macro($name, $macro)—Register a custom macro.
static make(string $name)static
markBand(int|float $from, int|float $to, ?string $label = null, ?string $color = null, int $axis = 1)static數值區間底色(正常範圍、目標帶)。
markDate(mixed $date, ?string $label = null, ?string $color = null, bool $dashed = true)static時間軸上的垂直標記線(發佈日、事件)。需要 dateField()。
markLine(int|float $value, ?string $label = null, ?string $color = null, int $axis = 1, bool $dashed = true)static水平參考線(目標值、警戒線)。橫向 bar 時是垂直線。
markPeriod(mixed $from, mixed $to, ?string $label = null, ?string $color = null)static時間區間底色(活動期間、維護時段)。需要 dateField()。
static mixin($mixin, $replace = true)—Mix another object into the class.
native(array $settings)static目前驅動的原生設定合併(amCharts:chart/xAxis/yAxis/yAxis2/cursor/legend/series.{key}; Chart.js:直接深度合併進 config)。換驅動時這些設定不會跟著套用到別的驅動。
numberFormat(string $format)static全圖數字格式(中立語法,例如 "#,###.##"、"#.#%"、"$#,###";各驅動自行轉譯);個別軸用 axis(format:) 覆寫。
palette(array $colors)static
pie()static
preset(string $name)static
rawConfig(array $config)static【amCharts 專屬】直接使用 amCharts 5 JSON config(JsonParser 格式),免學習/免遷移。 元件仍然負責資料載入、工具列、縮放同步、匯出與更新; rows 會自動寫入 config 中 ref 名稱為 "data" 的資料。
refresh(int $seconds)static每 N 秒重新呼叫 source;分頁隱藏時暫停。
renderer(string $renderer)static【amCharts 專屬】繪圖方式:canvas(預設;大量資料、即時更新較快)或 svg (向量、列印銳利,點擊判斷不讀像素,不受瀏覽器防指紋雜訊影響)。 全站預設見 config('cg-components.chart.driver_options.amcharts.renderer')。
requireSupport()static嚴格模式:驅動缺任何一項能力就丟例外,而不是讓前端靜默降級。
resolvedDriver()ChartDriver
resolvedRows()array
scatter()static
scrollbar(bool $x = true, bool $y = false)static
series(array $series)static序列。除了 ChartSeries,也接受簡寫: ->series(['revenue' => '營收', 'orders' => '訂單']) 欄位 => 顯示名稱 ->series(['revenue', 'orders']) 只給欄位(名稱同欄位) 要設定顏色、Y2、標籤等再用 ChartSeries::make()。
source(string $method, array $args = [])static資料來源:掛載的 Linker(->linker()/->stateless())上的方法。 方法回 ok(['rows' => [...]]) 取代資料,ok(['append' => [...]]) 追加。
spec()array
step()static
style(array $style)static完整樣式:fontFamily fontSize textColor gridColor background lineWidth areaOpacity columnRadius columnGap strokeColor tooltipFill。
syncZoom(string $group, ?string $call = null)static縮放範圍同步。同一頁、同一瀏覽器的其他分頁(BroadcastChannel)皆共用 group; 給 $call 時,範圍也會經 Linker 方法存到伺服器,其他客戶端靠 refresh() 輪詢套用。
tapSpec(Closure $tap)static對最終規格做最後修改(單一實例的擴充點)。Closure 收到規格陣列、回傳規格陣列。
tasks(array $tasks)static每個任務:id、name、start、duration(工作日,0=里程碑)、 progress(0–100)、parent、link(後續任務 id)、color。
theme(string $theme)static
time(array $ranges = ['1M', '3M', '6M', '1Y', 'all'], array $granularity = [])static時間導覽:預設範圍按鈕與資料彙總粒度(本地運算,不打伺服器)。
title(string $title, ?string $subtitle = null)static圖表上方的可見標題(accessible label 另用 label())。
type(string $type)static
unless($value = null, ?callable $callback = null, ?callable $default = null)—Apply the callback if the given "value" is (or resolves to) falsy.
unsupported()array規格需要、但目前驅動沒有的能力(空陣列=完整支援)。
when($value = null, ?callable $callback = null, ?callable $default = null)—Apply the callback if the given "value" is (or resolves to) truthy.
window(int $points)static滾動視窗:追加資料時只保留最後 N 筆。
withoutZoom()static
zoom(bool $x = true, bool $y = false, string $mode = 'select', bool $wheel = false)static縮放:select=拖曳框選放大、pan=拖曳平移。滾輪縮放預設關閉(避免捲動頁面時 被圖表劫持),要開請傳 wheel: true。
zoomOutButton(bool $show = true)static【amCharts 專屬】藍色圓形還原縮放按鈕。全站預設見 config('cg-components.chart.driver_options.amcharts.zoomOutButton');這裡覆寫單張圖。
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Checkbox ​

class

Cg\ComponentFramework\Component\Checkbox\Checkbox

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:checkbox · Category:Form Fields · Usage & example → · View:cg-component::Checkbox.CheckboxView

MethodReturns
checked(Closure|bool $condition = true)static
static make(string $name, Htmlable|Closure|string|null $label = null)static
uncheckedValue(string|int|float|bool|null $value)static
value(string|int|float|bool $value)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

ColorPicker ​

class

Cg\ComponentFramework\Component\ColorPicker\ColorPicker

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:color-picker · Category:Form Fields · Usage & example → · View:cg-component::ColorPicker.ColorPickerView

MethodReturns
static make(string $name, Htmlable|Closure|string|null $label = null)static
presets(array $colors)static
showText(Closure|bool $condition = true)static
uppercase(bool $condition = true)static
value(Closure|string $value)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

Combobox ​

class

Cg\ComponentFramework\Component\Combobox\Combobox

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:combobox · Category:Form Fields · Usage & example → · View:cg-component::Combobox.ComboboxView

MethodReturns
autocomplete(?string $autocomplete)static
clearable(Closure|bool $condition = true, string $label = '清除選取')static
emptyMessage(Closure|string $message)static
static make(string $name, Htmlable|Closure|string|null $label = null)static
options(Traversable|Closure|array $options)static
placeholder(Closure|string|null $placeholder)static
selected(Closure|string|int|float|null $value)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

DateInput ​

class

Cg\ComponentFramework\Component\DateInput\DateInput

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:date-input · Category:Form Fields · Usage & example → · View:cg-component::DateInput.DateInputView

Constants (allowed values)

  • MODES:date · datetime-local · time · month · week
MethodReturns
autocomplete(?string $autocomplete)static
static make(string $name, Htmlable|Closure|string|null $label = null)static
max(?string $value)static
min(?string $value)static
mode(string $mode)static
step(string|int|float|null $step)static
value(Closure|string|null $value)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

DatePicker ​

class

Cg\ComponentFramework\Component\DatePicker\DatePicker

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:date-picker · Category:Form Fields · Usage & example → · View:cg-component::DatePicker.DatePickerView

Constants (allowed values)

  • DISPLAY_FORMATS:Y-m-d · Y/m/d · d/m/Y · m/d/Y
MethodReturns
clearable(Closure|bool $condition = true)static
displayFormat(string $format)static
static make(string $name, Htmlable|Closure|string|null $label = null)static
max(?string $value)static
min(?string $value)static
placeholder(Closure|string|null $placeholder)static
value(Closure|string|null $value)static
weekStartsOn(int $day)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

Drawer ​

class

Cg\ComponentFramework\Component\Drawer\Drawer

Extends:Modal → Component → Node · Implements:Htmlable、RenderableNode · Catalog ID:drawer · Category:Overlays · Usage & example → · View:cg-component::Modal.ModalView

MethodReturns
static make(string $name, Htmlable|Closure|string|null $title = null, string $side = 'right')static
side(string $side)static
variant(string $variant)static
Inherited methods (34)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Modal:autofocus body bodyId closeButton description footer getName label modalAttributes openButton static

class

Cg\ComponentFramework\Component\DropdownMenu\DropdownMenu

原生 details disclosure;選單開關不需要自訂 JavaScript。

Extends:Action → Component → Node · Implements:ActionComponent、RenderableNode、Htmlable · Catalog ID:dropdown-menu · Category:Actions · Usage & example → · View:cg-component::DropdownMenu.DropdownMenuView

Constants (allowed values)

  • PLACEMENTS:start · end
  • WIDTHS:sm · md · lg
  • COLORS:neutral · primary · success · warning · danger · info
  • SIZES:sm · md · lg
  • VARIANTS:solid · outline · ghost
MethodReturns
actions(iterable $actions)static
static make(Htmlable|Closure|string $label, iterable $actions = [])static
open(bool $condition = true)static
placement(string $placement)static
push(ActionComponent $action)static
width(string $width)static
Inherited methods (34)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Action:closesModal color disabled icon iconOnly linkerCall opensModal size stateSet stateToggle variant

FieldSet ​

class

Cg\ComponentFramework\Component\FieldSet\FieldSet

Extends:Component → Node · Implements:Htmlable、RenderableNode、RequiresMultipart · Catalog ID:field-set · Category:Page Structure · Usage & example → · View:cg-component::FieldSet.FieldSetView

MethodReturns
columns(int $columns)static
components(iterable $components)static
description(Htmlable|Closure|string|null $description)static
disabled(Closure|bool $condition = true)static
hideLegend(bool $condition = true)static
static make(Htmlable|Closure|string $legend, iterable $components = [])static
push(Component $component)static
requiresMultipart()bool
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

File ​

class

Cg\ComponentFramework\Component\File\File

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:file · Category:Content & Media · Usage & example → · View:cg-component::File.FileView

Constants (allowed values)

  • TARGETS:_self · _blank
  • VARIANTS:default · compact
MethodReturns
description(Htmlable|Closure|string|null $description)static
disabled(Closure|bool $condition = true)static
download(string|bool $filename = true)static
icon(Icon|string|null $icon)static
static make(Htmlable|Closure|string $name, Closure|string $url)static
mimeType(Closure|string|null $mimeType)static
modifiedAt(DateTimeInterface|Closure|null $modifiedAt)static
newTab(bool $condition = true)static
sizeBytes(Closure|int|null $bytes)static
variant(string $variant)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

FileUpload ​

class

Cg\ComponentFramework\Component\FileUpload\FileUpload

Extends:Field → Component → Node · Implements:Htmlable、RenderableNode、FieldComponent、RequiresMultipart · Catalog ID:file-upload · Category:Form Fields · Usage & example → · View:cg-component::FileUpload.FileUploadView

MethodReturns
accept(array|string|null $types)static
capture(?string $facingMode = 'environment')static
imageOnly()static
static make(string $name, Htmlable|Closure|string|null $label = null)static
maxFiles(?int $count)static
maxSize(?int $kilobytes)static
multiple(Closure|bool $condition = true)static
requiresMultipart()bool
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

class

Cg\ComponentFramework\Component\Footer\Footer

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:footer · Category:Page Structure · Usage & example → · View:cg-component::Footer.FooterView

Constants (allowed values)

  • VARIANTS:default · muted · dark
MethodReturns
actions(Actions|Traversable|array $actions)static
bordered(bool $condition = true)static
columns(iterable $components)static
copyright(Htmlable|Closure|string|null $copyright)static
static make(Htmlable|Closure|string|null $copyright = null)static
push(Component $component)static
variant(string $variant)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

class

Cg\ComponentFramework\Component\Header\Header

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:header · Category:Page Structure · Usage & example → · View:cg-component::Header.HeaderView

Constants (allowed values)

  • VARIANTS:default · transparent · dark
MethodReturns
actions(Actions|Traversable|array $actions)static
bordered(bool $condition = true)static
brand(Htmlable|Closure|string|null $brand, Closure|string|null $url = null)static
compact(bool $condition = true)static
content(iterable $components)static
static make(Htmlable|Closure|string|null $brand = null)static
push(Component $component)static
sticky(bool $condition = true)static
variant(string $variant)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Heading ​

class

Cg\ComponentFramework\Component\Heading\Heading

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:heading · Category:Primitives · Usage & example → · View:cg-component::Heading.HeadingView

Constants (allowed values)

  • SIZES:xs · sm · md · lg · xl · 2xl
MethodReturns
description(?string $description)static
level(int $level)static
static make(Htmlable|Closure|string $content)static
size(?string $size)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Hero ​

class

Cg\ComponentFramework\Component\Hero\Hero

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:hero · Category:Page Structure · Usage & example → · View:cg-component::Hero.HeroView

Constants (allowed values)

  • ALIGNMENTS:start · center
  • SIZES:sm · md · lg
  • TONES:default · muted · primary · dark
MethodReturns
actions(Actions|Traversable|array $actions)static
align(string $alignment)static
body(mixed $content)static
description(Htmlable|Closure|string|null $description)static
eyebrow(Htmlable|Closure|string|null $eyebrow)static
headingLevel(int $level)static
static make(Htmlable|Closure|string $title)static
media(?Component $media)static
size(string $size)static
tone(string $tone)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Icon ​

class

Cg\ComponentFramework\Component\Icon\Icon

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:icon · Category:Primitives · Usage & example → · View:cg-component::Icon.IconView

Constants (allowed values)

  • SIZES:xs · sm · md · lg · xl
MethodReturnsNotes
getName()string
label(?string $label)staticnull 代表裝飾圖示,非 null 代表有語意的圖片。
static make(Closure|string $name)static
size(string $size)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Image ​

class

Cg\ComponentFramework\Component\Image\Image

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:image · Category:Primitives · Usage & example → · View:cg-component::Image.ImageView

Constants (allowed values)

  • FITS:contain · cover · fill · none · scale-down
MethodReturns
dimensions(?int $width, ?int $height)static
eager(bool $condition = true)static
fit(string $fit)static
static make(Closure|string $source, Closure|string $alt = '')static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

ItemList ​

class

Cg\ComponentFramework\Component\ItemList\ItemList

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:item-list · Category:Data · Usage & example → · View:cg-component::ItemList.ItemListView

Constants (allowed values)

  • SPACINGS:none · sm · md · lg
MethodReturns
divided(bool $condition = true)static
items(iterable $items)static
label(?string $label)static
static make(iterable $items = [])static
ordered(bool $condition = true, int $start = 1)static
push(ListItem $item)static
spacing(string $spacing)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Label ​

class

Cg\ComponentFramework\Component\Label\Label

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:label · Category:Primitives · Usage & example → · View:cg-component::Label.LabelView

MethodReturns
for(?string $id)static
static make(Htmlable|Closure|string $content, ?string $for = null)static
required(bool $condition = true)static
visuallyHidden(bool $condition = true)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

class

Cg\ComponentFramework\Component\Link\Link

Extends:Action → Component → Node · Implements:ActionComponent、RenderableNode、Htmlable · Catalog ID:link · Category:Actions · Usage & example → · View:cg-component::Link.LinkView

Constants (allowed values)

  • TARGETS:_self · _blank · _parent · _top
  • COLORS:neutral · primary · success · warning · danger · info
  • SIZES:sm · md · lg
  • VARIANTS:solid · outline · ghost
MethodReturns
download(string|bool $download = true)static
static make(Htmlable|Closure|string $label, Closure|string $url = '#')static
newTab(bool $condition = true)static
rel(array|string $relations)static
target(string $target)static
Inherited methods (34)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Action:closesModal color disabled icon iconOnly linkerCall opensModal size stateSet stateToggle variant

class

Cg\ComponentFramework\Component\Modal\Modal

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:modal · Category:Overlays · Usage & example → · View:cg-component::Modal.ModalView

MethodReturns
autofocus(?string $selector)static
body(mixed $body)static
bodyId()string
closeButton(bool $condition = true)static
description(Closure|string|null $description)static
footer(Actions|Traversable|array $actions)static
getName()string
label(?string $label)static
static make(string $name, Htmlable|Closure|string|null $title = null)static
modalAttributes()HtmlString
openButton(Htmlable|Closure|string $label)Button
static(bool $condition = true)static
variant(string $variant)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

class

Cg\ComponentFramework\Component\Navigation\Navigation

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:navigation · Category:Navigation · Usage & example → · View:cg-component::Navigation.NavigationView

Constants (allowed values)

  • ORIENTATIONS:horizontal · vertical
MethodReturns
items(iterable $items)static
label(string $label)static
static make(iterable $items = [])static
orientation(string $orientation)static
push(NavigationItem $item)static
single(bool $condition = true)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Pagination ​

class

Cg\ComponentFramework\Component\Pagination\Pagination

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:pagination · Category:Navigation · Usage & example → · View:cg-component::Pagination.PaginationView

MethodReturnsNotes
hideWhenSinglePage(bool $condition = true)static
label(string $label)static
linkerPaginate(string $method, array $extra = [])static
static make(Paginator|CursorPaginator|Closure $paginator)static
onEachSide(int $pages)static
pageAttributes(string|int|null $page)HtmlStringint=頁碼;string=cursor 分頁的游標,參數名稱改為 cursor。
renderPagesWith(string $controller, string $target, string $method = 'components', array $params = [], array $extra = [])static
safePageUrl(Paginator $paginator, int $page)string
showSummary(bool $condition = true)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Popover ​

class

Cg\ComponentFramework\Component\Popover\Popover

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:popover · Category:Overlays · Usage & example → · View:cg-component::Popover.PopoverView

Constants (allowed values)

  • PLACEMENTS:top · right · bottom · left
  • ALIGNS:start · center · end
  • WIDTHS:sm · md · lg
MethodReturns
content(mixed $content)static
dismissible(bool $condition = true, string $label = '關閉浮動內容')static
id(string $id)static
label(?string $label)static
static make(Component $trigger, mixed $content = null)static
offset(int $pixels)static
open(bool $condition = true)static
placement(string $placement, string $align = 'start')static
stateKey(string $key)static
title(Htmlable|Closure|string|null $title)static
width(string $width)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

ProgressBar ​

class

Cg\ComponentFramework\Component\ProgressBar\ProgressBar

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:progress-bar · Category:Status & Progress · Usage & example → · View:cg-component::ProgressBar.ProgressBarView

Constants (allowed values)

  • COLORS:primary · success · warning · danger · info
  • SIZES:sm · md · lg
MethodReturns
color(string $color)static
label(Closure|string $label)static
static make(Closure|string $label = '處理進度')static
range(int|float $min, int|float $max)static
showLabel(bool $condition = true)static
showValue(Closure|bool $condition = true)static
size(string $size)static
unit(string $suffix, string $prefix = '')static
value(Closure|int|float|null $value)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

ProgressIndicator ​

class

Cg\ComponentFramework\Component\ProgressIndicator\ProgressIndicator

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:progress-indicator · Category:Status & Progress · Usage & example → · View:cg-component::ProgressIndicator.ProgressIndicatorView

Constants (allowed values)

  • COLORS:primary · success · warning · danger · info
  • SIZES:sm · md · lg · xl
MethodReturns
color(string $color)static
label(Closure|string $label)static
static make(Closure|string $label = '處理進度')static
range(int|float $min, int|float $max)static
showValue(Closure|bool $condition = true)static
size(string $size)static
unit(string $suffix, string $prefix = '')static
value(Closure|int|float|null $value)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Quote ​

class

Cg\ComponentFramework\Component\Quote\Quote

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:quote · Category:Content & Media · Usage & example → · View:cg-component::Quote.QuoteView

Constants (allowed values)

  • ALIGNMENTS:start · center · end
  • SIZES:sm · md · lg
MethodReturns
align(string $alignment)static
author(Htmlable|Closure|string|null $author)static
static make(Htmlable|Closure|string $content)static
size(string $size)static
source(Htmlable|Closure|string|null $title, Closure|string|null $url = null)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

RadioButton ​

class

Cg\ComponentFramework\Component\RadioButton\RadioButton

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:radio-button · Category:Form Fields · Usage & example → · View:cg-component::RadioButton.RadioButtonView

MethodReturns
checked(Closure|bool $condition = true)static
getId()string
static make(string $name, string|int|float|bool $value, Htmlable|Closure|string|null $label = null)static
Inherited methods (35)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getName helperText id label linkerCall live readOnly required state

Rating ​

class

Cg\ComponentFramework\Component\Rating\Rating

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:rating · Category:Form Fields · Usage & example → · View:cg-component::Rating.RatingView

MethodReturns
clearable(Closure|bool $condition = true, string $label = '清除評分')static
static make(string $name, Htmlable|Closure|string|null $label = null)static
max(int $max)static
showValue(Closure|bool $condition = true)static
value(Closure|int|null $value)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

RichTextEditor ​

class

Cg\ComponentFramework\Component\RichTextEditor\RichTextEditor

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:rich-text-editor · Category:Form Fields · Usage & example → · View:cg-component::RichTextEditor.RichTextEditorView

Constants (allowed values)

  • TOOLS:bold · italic · underline · strike · heading2 · heading3 · bulletList · orderedList · blockquote · code · undo · redo · clear
  • HEIGHTS:sm · md · lg
MethodReturns
height(string $height)static
static make(string $name, Htmlable|Closure|string|null $label = null)static
maxLength(?int $length)static
placeholder(Closure|string|null $placeholder)static
static sanitize(string $html)string
tools(array $tools)static
value(Closure|string|null $value)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

SearchInput ​

class

Cg\ComponentFramework\Component\SearchInput\SearchInput

Extends:TextInput → Field → Component → Node · Implements:Htmlable、RenderableNode、FieldComponent · Catalog ID:search-input · Category:Form Fields · Usage & example → · View:cg-component::SearchInput.SearchInputView

Constants (allowed values)

  • TYPES:text · email · password · url · tel · search · number · date · time · datetime-local · month · week · color · range
MethodReturns
clearable(Closure|bool $condition = true, string $label = '清除搜尋內容')static
static make(string $name, Htmlable|Closure|string|null $label = null)static
submitButton(Htmlable|Closure|string|null $label = '搜尋')static
type(string $type)static
Inherited methods (45)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from TextInput:autocomplete inputMode max maxLength min minLength placeholder step value

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

SegmentedControl ​

class

Cg\ComponentFramework\Component\SegmentedControl\SegmentedControl

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:segmented-control · Category:Form Fields · Usage & example → · View:cg-component::SegmentedControl.SegmentedControlView

Constants (allowed values)

  • SIZES:sm · md · lg
MethodReturns
block(bool $condition = true)static
disableOptions(iterable $values)static
static make(string $name, Htmlable|Closure|string|null $label = null)static
options(Traversable|Closure|array $options)static
selected(mixed $value)static
size(string $size)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

Select ​

class

Cg\ComponentFramework\Component\Select\Select

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:select · Category:Form Fields · Usage & example → · View:cg-component::Select.SelectView

MethodReturns
static make(string $name, Htmlable|Closure|string|null $label = null)static
multiple(Closure|bool $condition = true)static
options(Traversable|Closure|array $options)static
placeholder(Closure|string|null $placeholder)static
selected(mixed $value)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

Separator ​

class

Cg\ComponentFramework\Component\Separator\Separator

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:separator · Category:Primitives · Usage & example → · View:cg-component::Separator.SeparatorView

Constants (allowed values)

  • ORIENTATIONS:horizontal · vertical
MethodReturns
static make(Closure|string|null $label = null)static
orientation(string $orientation)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Skeleton ​

class

Cg\ComponentFramework\Component\Skeleton\Skeleton

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:skeleton · Category:Status & Progress · Usage & example → · View:cg-component::Skeleton.SkeletonView

Constants (allowed values)

  • SHAPES:text · rectangle · circle
  • ANIMATIONS:pulse · wave · none
MethodReturns
animation(string $animation)static
decorative(bool $condition = true)static
dimensions(string|int|float $width, string|int|float|null $height = null)static
label(string $label)static
lines(int $lines)static
static make(string $label = '載入中')static
shape(string $shape)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

class

Cg\ComponentFramework\Component\SkipLink\SkipLink

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:skip-link · Category:Accessibility · Usage & example → · View:cg-component::SkipLink.SkipLinkView

Constants (allowed values)

  • POSITIONS:start · center · end
MethodReturns
label(Htmlable|Closure|string $label)static
static make(string $target, Htmlable|Closure|string $label = '跳至主要內容')static
position(string $position)static
target(string $target)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Slider ​

class

Cg\ComponentFramework\Component\Slider\Slider

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:slider · Category:Form Fields · Usage & example → · View:cg-component::Slider.SliderView

MethodReturns
static make(string $name, Htmlable|Closure|string|null $label = null)static
range(int|float $min, int|float $max)static
showValue(Closure|bool $condition = true)static
step(int|float $step)static
unit(string $suffix, string $prefix = '')static
value(Closure|int|float|null $value)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

Sound ​

class

Cg\ComponentFramework\Component\Sound\Sound

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:sound · Category:Content & Media · Usage & example → · View:cg-component::Sound.SoundView

Constants (allowed values)

  • PRELOADS:none · metadata · auto
  • CROSS_ORIGINS:anonymous · use-credentials
MethodReturns
addSource(SoundSource $source)static
addTrack(SoundTrack $track)static
crossOrigin(?string $crossOrigin)static
loop(bool $condition = true)static
static make(Closure|string|null $source, Closure|string $label = '音訊')static
muted(bool $condition = true)static
preload(string $preload)static
showLabel(bool $condition = true)static
source(Closure|string $source, ?string $type = null)static
sources(iterable $sources)static
tracks(iterable $tracks)static
transcript(mixed $content, string $label = '顯示逐字稿', bool $open = false)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Spinner ​

class

Cg\ComponentFramework\Component\Spinner\Spinner

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:spinner · Category:Status & Progress · Usage & example → · View:cg-component::Spinner.SpinnerView

Constants (allowed values)

  • COLORS:current · primary · success · warning · danger · info
  • SIZES:xs · sm · md · lg · xl
MethodReturns
color(string $color)static
decorative(bool $condition = true)static
label(string $label)static
static make(string $label = '載入中')static
size(string $size)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Stack ​

class

Cg\ComponentFramework\Component\Stack\Stack

Extends:Component → Node · Implements:Htmlable、RenderableNode、RequiresMultipart · Catalog ID:stack · Category:Primitives · Usage & example → · View:cg-component::Stack.StackView

Constants (allowed values)

  • DIRECTIONS:row · column
  • GAPS:none · xs · sm · md · lg · xl
  • ALIGNS:start · center · end · stretch · baseline
  • JUSTIFIES:start · center · end · between · around · evenly
MethodReturns
align(string $align)static
components(iterable $components)static
direction(string $direction)static
gap(string $gap)static
getComponents()NodeCollection
justify(string $justify)static
static make(iterable $components = [])static
push(Component $component)static
requiresMultipart()bool
wrap(bool $condition = true)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Stepper ​

class

Cg\ComponentFramework\Component\Stepper\Stepper

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:stepper · Category:Status & Progress · Usage & example → · View:cg-component::Stepper.StepperView

Constants (allowed values)

  • ORIENTATIONS:horizontal · vertical
MethodReturns
active(?string $key)static
label(string $label)static
static make(iterable $steps = [])static
numbered(bool $condition = true)static
orientation(string $orientation)static
push(Step $step)static
steps(iterable $steps)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Table ​

class

Cg\ComponentFramework\Component\Table\Table

資料表。

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:table · Category:Data · Usage & example → · View:cg-component::Table.TableView

Constants (allowed values)

  • FILTER_LAYOUTS:dropdown · inline
  • MAX_HEIGHTS:sm · md · lg · xl · screen
MethodReturnsNotes
activeLeaves(TableColumnNode $node, array $shown, TableState $state)array
afterResolve(Closure $callback)static
caption(Htmlable|Closure|string|null $caption)static
columns(iterable $columns)static
compact(bool $condition = true)static
config(string $name)mixed
copy()static深層複製:欄位、篩選器都是新的實例,修改副本不會影響原本的表格。
currentRequest()Request
cursorPagination(bool $condition = true)static游標分頁:以排序欄位的值定位,大資料表不需要 OFFSET 掃描也不計算總數。
defaultGroup(?string $group)static
defaultSort(string $column, string $direction = 'asc')static
detail(?Closure $content, string $label = '詳細資料')static每列可展開的自訂內容;收合欄位(Column::collapsible())會排在它前面。
eagerLoadRelations(bool $condition = true)staticEloquent 資料源預設會 eager load 點號欄位用到的關聯。
emptyState(Htmlable|Closure|string $content)static
filters(iterable $filters)static
filtersLayout(string $layout)static
foreignQuery(array $without = [])array目前 request 中不屬於這張表的 query 參數。
getPageName()string
getRecords()array
getState()TableState
groupBy(Group|string $group)static直接依某欄分組;等同 groups([$group])->defaultGroup(...)。
groups(array $groups)static
hoverable(bool $condition = true)static
label(string $label)static
linkerNavigation(?string $method = 'navigate', array $extra = [])static搜尋、篩選、排序、分頁、欄位切換與欄位順序改走 Linker,不再整頁導覽。
static make(iterable $columns = [])static
maxHeight(?string $height)static
model(string $model)static
modifyQueryUsing(Closure $callback)static在搜尋、篩選、排序之前修改查詢。查詢資料源收到 Builder,記憶體資料源收到 Collection (回傳新的 iterable 會取代原資料)。可呼叫多次,依序執行。
paginate(int $perPage = 15, array $options = [])static啟用分頁並定義每頁筆數。
pagination(Pagination|Closure|null $pagination)static外部提供的 Pagination;Table 自行分頁時可傳 Closure 客製: fn (Paginator $paginator, Table $table) => Pagination::make($paginator)->renderPagesWith(...)
paginationMode(string $mode)staticlength(COUNT 總數)、simple(LIMIT/OFFSET 不計數)、cursor(游標,不計數也不 OFFSET)。
paramName(string ...$segments)string表格參數的 input name:paramName('filters', 'status') → filters[status] 或 orders[filters][status]。
perPageOptions(array $options)static
static persistOrder(Builder|Relation|Builder $query, array $keys, string $column = 'sort', int $offset = 0, ?string $keyName = null)int把拖曳後的順序寫回資料庫。只會更新 $query 範圍內、且在 $keys 中的紀錄, 竄改的 key 不會影響其他資料。
pushColumn(TableColumnNode $column)static
query(Builder|Relation|Builder|Closure $query)staticrecords() 的語意化別名:交給資料庫搜尋、篩選、排序與分頁。
queryStringIdentifier(?string $identifier)static同頁有多個 Table 時,用它把 query string 分開:orders[search]、orders_page。
records(mixed $records)static資料來源:array、Collection、LazyCollection、任何 iterable、Paginator、CursorPaginator、 Eloquent/Query Builder、Relation,或回傳上述任一者的 Closure(收到 Table)。
recordTitle(Closure|string|null $title)static
reorderable(string $column, string $linkerMethod, array $extra = [])static讓使用者拖曳列重新排序,放開時呼叫 Linker 方法,參數: {order: [rowKey, ...], offset: 本頁第一筆的位置, column: 排序欄位, ...extra}。 伺服器端可直接用 Table::persistOrder() 寫回。表格需放在該 Linker 的掛載點內。
reorderableColumns(bool $condition = true)static讓使用者拖曳表頭調整欄位順序(ColumnGroup 內只能在群組內移動);順序寫進 URL。
request(?Request $request)static
resolve()TableResult執行查詢並回傳與渲染無關的結果。每次呼叫都會重新查詢。
rowKey(Closure|string|null $key)static
searchPlaceholder(string $placeholder)static
simplePagination(bool $condition = true)static傳統 LIMIT/OFFSET,但不執行 COUNT 查詢。
stackOn(?string $breakpoint = 'md')static容器寬度小於斷點時,每筆資料改成「標籤:值」的卡片堆疊。 使用 container query,表格放在窄側欄也會正確堆疊,不需要 JavaScript。
state(TableState|Closure|array|null $state)static直接指定狀態而不讀 request(測試、renderBlade 片段或伺服器端重新導向時使用)。
stickyFooter(bool $condition = true)static捲動時固定 tfoot(彙總列)。
stickyHeader(bool $condition = true)static捲動時固定表頭。搭配 maxHeight() 讓表格在自己的容器內捲動。
striped(bool $condition = true)static
summaryLabels(array $labels)static
tableId()string
transpose(bool $condition = true)static轉置輸出方向:欄位變成列、紀錄變成欄(適合規格比較表)。 不支援 groups()、detail()、reorderable();collapsible 欄位會當成一般列輸出。
urlFor(TableState $state, bool $keepPage = false)string以指定狀態產生目前頁面的 URL;保留其他 query 參數(例如同頁另一張表)。
wrapTableQuery(array $tableQuery)array
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Tabs ​

class

Cg\ComponentFramework\Component\Tabs\Tabs

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:tabs · Category:Data · Usage & example → · View:cg-component::Tabs.TabsView

Constants (allowed values)

  • ORIENTATIONS:horizontal · vertical
  • ACTIVATIONS:automatic · manual
MethodReturns
activation(string $activation)static
active(?string $key)static
getTabs()NodeCollection
label(string $label)static
static make(iterable $tabs = [])static
orientation(string $orientation)static
push(Tab $tab)static
stateKey(string $key)static
tabs(iterable $tabs)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

TextArea ​

class

Cg\ComponentFramework\Component\TextArea\TextArea

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:text-area · Category:Form Fields · Usage & example → · View:cg-component::TextArea.TextAreaView

MethodReturns
static make(string $name, Htmlable|Closure|string|null $label = null)static
maxLength(?int $length)static
minLength(?int $length)static
placeholder(Closure|string|null $placeholder)static
rows(int $rows)static
value(mixed $value)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

TextInput ​

class

Cg\ComponentFramework\Component\TextInput\TextInput

Extends:Field → Component → Node · Implements:FieldComponent、RenderableNode、Htmlable · Catalog ID:text-input · Category:Form Fields · Usage & example → · View:cg-component::TextInput.TextInputView

Constants (allowed values)

  • TYPES:text · email · password · url · tel · search · number · date · time · datetime-local · month · week · color · range
MethodReturns
autocomplete(?string $autocomplete)static
inputMode(?string $mode)static
static make(string $name, Htmlable|Closure|string|null $label = null)static
max(string|int|float|null $value)static
maxLength(?int $length)static
min(string|int|float|null $value)static
minLength(?int $length)static
placeholder(Closure|string|null $placeholder)static
step(string|int|float|null $value)static
type(string $type)static
value(mixed $value)static
Inherited methods (36)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

Toast ​

class

Cg\ComponentFramework\Component\Toast\Toast

Extends:Alert → Component → Node · Implements:Htmlable、RenderableNode · Catalog ID:toast · Category:Feedback · Usage & example → · View:cg-component::Toast.ToastView

MethodReturns
delay(int $milliseconds)static
id(string $id)static
static make(Htmlable|Closure|string $message)static
stay(bool $closeable = true)static
timeout(int $milliseconds)static
Inherited methods (34)

from Alert:actions danger dismissible icon info message success title type visibilityState warning

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Toggle ​

class

Cg\ComponentFramework\Component\Toggle\Toggle

Extends:Checkbox → Field → Component → Node · Implements:Htmlable、RenderableNode、FieldComponent · Catalog ID:toggle · Category:Form Fields · Usage & example → · View:cg-component::Toggle.ToggleView

Constants (allowed values)

  • COLORS:primary · success · warning · danger
  • SIZES:sm · md · lg
MethodReturns
color(string $color)static
inline(bool $condition = true)static
static make(string $name, Htmlable|Closure|string|null $label = null)static
size(string $size)static
Inherited methods (39)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

from Checkbox:checked uncheckedValue value

from Field:disabled error errorBag getId getName helperText id label linkerCall live readOnly required state

Tooltip ​

class

Cg\ComponentFramework\Component\Tooltip\Tooltip

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:tooltip · Category:Overlays · Usage & example → · View:cg-component::Tooltip.TooltipView

Constants (allowed values)

  • PLACEMENTS:top · right · bottom · left
MethodReturns
delay(int $milliseconds)static
id(string $id)static
static make(Component $trigger, Closure|string $content)static
offset(int $pixels)static
placement(string $placement)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

TreeView ​

class

Cg\ComponentFramework\Component\TreeView\TreeView

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:tree-view · Category:Data · Usage & example → · View:cg-component::TreeView.TreeViewView

Constants (allowed values)

  • SELECTION_MODES:none · single · multiple
MethodReturns
expanded(Closure|array|string|null $keys)static
label(string $label)static
static make(iterable $nodes = [])static
nodes(iterable $nodes)static
push(TreeNode $node)static
selected(Closure|array|string|null $keys)static
selection(string $mode)static
stateKeys(string $selection, string $expanded)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

Video ​

class

Cg\ComponentFramework\Component\Video\Video

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:video · Category:Content & Media · Usage & example → · View:cg-component::Video.VideoView

Constants (allowed values)

  • PRELOADS:none · metadata · auto
  • CROSS_ORIGINS:anonymous · use-credentials
MethodReturns
addSource(VideoSource $source)static
addTrack(VideoTrack $track)static
autoplay(bool $condition = true)static
controls(bool $condition = true)static
crossOrigin(?string $crossOrigin)static
dimensions(?int $width, ?int $height)static
loop(bool $condition = true)static
static make(Closure|string|null $source, Closure|string $label = '影片')static
muted(bool $condition = true)static
playsInline(bool $condition = true)static
poster(Closure|string|null $poster)static
preload(string $preload)static
source(Closure|string $source, ?string $type = null)static
sources(iterable $sources)static
tracks(iterable $tracks)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData

VisuallyHidden ​

class

Cg\ComponentFramework\Component\VisuallyHidden\VisuallyHidden

Extends:Component → Node · Implements:RenderableNode、Htmlable · Catalog ID:visually-hidden · Category:Accessibility · Usage & example → · View:cg-component::VisuallyHidden.VisuallyHiddenView

Constants (allowed values)

  • TAGS:span · div · p
MethodReturns
as(string $tag)static
focusable(bool $condition = true)static
static make(Htmlable|Closure|string $content)static
Inherited methods (23)

from Node:attribute attributes attributesHtml attributeTokens class getAttribute getView hidden interactionAttributes isVisible key linker nodeType render renderAuto renderBlade renderObject stateless toHtml toView view visible withViewData


Generated from source by scripts/wiki-components/generate.php via reflection. Do not edit by hand.