定制 symfinity/ux-blocks-form 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

symfinity/ux-blocks-form

Composer 安装命令:

composer require symfinity/ux-blocks-form

包简介

Form domain Twig components: labels, inputs, compounds, and native interaction CSS

README 文档

README

UX Blocks Form

Form domain Twig components: labels, inputs, compounds, and native interaction CSS

PHP Version Symfony
CI
Release Downloads License

Note

Read-only mirror. See CONTRIBUTING.md for how to propose changes.

Features

  • Seventeen form roles — labels, text controls, toggles, selects, compounds, and form shells
  • Native-first (nat) — styled with ui-kernel tokens and package CSS; no Stimulus required for default markup
  • Composition compoundsField and FloatingField with labelled regions for control, hint, and error text
  • Toggle button appearanceappearance="button" on Checkbox, Radio, and segmented RadioGroup
  • Input adornments — icon slots and automatic icons on date/time inputs
  • Symfony UX Twig components<twig:Input>, <twig:Field>, <twig:Select>, and siblings
  • Flex recipe — bundle registration on install
  • Optional Symfony Form bridge — pair with symfinity/form-ui-extensions-bundle for FormView widgets

button and button-group ship in **symfinity/ux-blocks-core** (used by InputGroup and toggle-button labels).

Interaction profile

Token In this package
nat Default for all roles — native HTML + ui-kernel / package CSS
act Toggle-button labels use core Button chrome; InputGroup composes core Button
stl Not included — overlay components ship in symfinity/ux-blocks-extended
live Not included — LiveComponents ship in separate packages

Component inventory

Role Twig Interaction Fragment Status
label Label nat blocks.label shipped
input Input nat blocks.input shipped
textarea Textarea nat blocks.textarea shipped
checkbox Checkbox nat blocks.checkbox shipped
radio-group RadioGroup nat blocks.radio-group shipped
select Select nat blocks.select shipped
switch Switch nat blocks.switch shipped
file-input FileInput nat blocks.file-input shipped
input-group InputGroup nat blocks.input-group shipped
fieldset Fieldset nat blocks.fieldset shipped
field Field nat blocks.field shipped
floating-field FloatingField nat blocks.floating-field shipped
range Range nat blocks.range shipped
radio Radio nat blocks.radio shipped
form Form nat blocks.form shipped
form-actions FormActions nat blocks.form-actions shipped
file-upload FileUpload nat blocks.file-upload shipped

Highlights: Select supports multiple and enhanced styling where the browser allows; Range optional value readout; FileUpload combines a button with a filename display; do not wrap Select inside FloatingField; FormActions supports align: start, stretch, or end.

Handbook: docs/components.md.

Prerequisites

Add the symfinity/recipes Flex endpoint to your project's composer.json (see recipes README) — recipes are not in Symfony's official recipe repository yet.

Installation

composer require symfinity/ux-blocks-form

Composer installs symfinity/ux-blocks-core and symfinity/ux-blocks automatically. The Flex recipe registers the bundle for all environments. See Installation for manual setup and verification.

Pair with **symfinity/ui-kernel** when you need theme CSS — see Quick start.

Quick Start

{# templates/base.html.twig — ui-kernel head (recommended) #}
<head>
    {{ ui_kernel_theme_boot_script() }}
    {{ ui_kernel_css()|raw }}
</head>
{# templates/register.html.twig #}
<twig:Form title="Create account" method="post">
    <twig:Field label="Email" hint="We never share your email.">
        <twig:Input name="email" type="email" placeholder="you@example.com" required />
    </twig:Field>
    <twig:Field label="Password">
        <twig:Input name="password" type="password" required />
    </twig:Field>
    <twig:FormActions align="end">
        <twig:Button type="submit">Sign up</twig:Button>
    </twig:FormActions>
</twig:Form>
{# Segmented choice — toggle button appearance #}
<twig:RadioGroup name="plan" appearance="button" variant="primary">
    <twig:Radio value="free" label="Free" checked />
    <twig:Radio value="pro" label="Pro" />
</twig:RadioGroup>

See Quick start for validation states and optional Form bridge pairing.

Documentation

Requirements

  • PHP 8.2 or higher
  • Symfony 7.4 or 8.x
  • Transitive: symfinity/ux-blocks-core ^0.1, symfinity/ux-blocks ^0.1

Support

License

MIT

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固