npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rax-ui/text-field

v1.0.0-beta.62

Published

Rax UI Text Field

Downloads

25

Readme


display: TextField family: Data Entry

TextField

单行/多行文本输入

API

Props

| 名称 | 说明 | 类型 | 默认值 | | :------------ | :------------------------------------------------------------------------------ | :----------------------------------------------- | :----- | | type | 输入框类型 可选值: text, url, password, tel, email, number | enum | text | | label | 标签文本 | string | | | icon | 输入框左侧图标 | string | | | labelWidth | 标签文本宽度 | string | | | labelType | 标签类型 可选值: inner upper dynamic | | | actionIcon | 输入框最右侧的图标 | node | | | multiline | 是否可以输入多行文本 | bool | false | | rows | 输入文本框的行数(在 multiline=true 时生效 ) | number | 3 | | value | 输入值(受控) | string | | defaultValue | 默认输入框的值(非受控) | string | | maxLength | 可输入的最大字符数 | number | | | limitHint | 是否显示输入字符的提示 | string | | | disabled | 输入框是否被禁用 | bool | false | | readOnly | 是否只读 | bool | false | | solo | 是否只有输入框,不包含 label 和 errorText 、HelpText) | bool | false | | outline | 是否显示边框 | bool | false | | clear | 是否可以被清除 | bool | false | | placeholder | 提示文案 | string | | | helpText | 帮助文案 | node | | | errorText | 错误文案(设置此项后,输入框变为 error 状态,helpText 无效) | node | | | align | 输入内容对齐方向 可选值: leftcenterright | enum | left | | prepend | 前置内容 | node | | | append | 后置内容 | node | | | renderInput | 自定义渲染 <input /> | ({value, placeholder, align, style }) => RaxNode | | | onClick | 输入框部分被点击时的回调 | (): void | | | onActionClick | actionIcon 被点击时的回调 | (): void | | | onChange | change 事件的回调 | (value: string): void | | | onFocus | focus 事件的回调 | (): void | | | onBlur | blur 事件的回调 | (): void | |

CSS API

css 结构

<text-field>
  <text-field__input>
    <text-field__line>
      <text-field__input-addon>
        // prepend
        <text-field__input-addon-text>
          <text-field__input-content>
            <text-field__input-label>
              <text-field__input-element>
                <text-field__input-action>
                  <text-field__input-action-icon>
                    <text-field__input-addon>
                      // --append
                      <text-field__input-addon-text>
                        <text-field__helper>
                          <text-field__helper-text></text-field__helper-text></text-field__helper></text-field__input-addon-text></text-field__input-addon></text-field__input-action-icon></text-field__input-action></text-field__input-element></text-field__input-label></text-field__input-content></text-field__input-addon-text></text-field__input-addon></text-field__line></text-field__input
></text-field>

| 名称 | 说明 | | :------------------------------------------ | :--------------------------------------------------- | | text-field | 输入框容器样式 | | text-field__input | 输入框样式 | | text-field__input-label | 输入框标签样式 | | text-field__input-content | 输入框内容样式 | | text-field__input-element | 输入框 <input> 元素样式 | | text-field__input-action | 动作样式 (clear) | | text-field__input-action-icon | 动作图标样式 | | text-field__input-addon | addon 样式 | | text-field__input-addon--prepend | addon 前置时的样式 | | text-field__input-addon--append | addon 后置时的样式 | | text-field__input-addon-text | addon 文字 & icon 样式 | | text-field__line | 输入框外框线的样式 | | text-field__helper | 帮助区域样式 | | text-field__helper-text | 帮助文本样式 | | text-field--label-top__input-content | labelType="upper" 时的内容样式 | | text-field--label-top__input-label | labelType="upper" 时的标签样式 | | text-field--label--dynamic__input-content | labelType="dynamic" && outline={true} 时的内容样式 | | text-field--label--dynamic__input-label | labelType="dynamic" && outline={true} 时的标签样式 | | text-field--outline__input | outlint={true} 时输入框的样式 | | text-field--outline__line | outlint={true} 时外框线的样式 | | text-field--multiline__input | multiline={true} 时输入框的样式 | | text-field--multiline__input-content | multiline={true} 时外框线的样式 | | text-field--focused__input-label | 输入框获得焦点时的标签样式 | | text-field--focused__line | 输入框获得焦点时的外框线样式 | | text-field--error__input-label | errorText="xxx" 时的标签样式 | | text-field--error__line | errorText="xxx" 时的外框线样式 | | text-field--error__helper-text | errorText="xxx" 时的帮助文字样式 | | text-field--disabled__input | disabled={true} 时的输入框样式 | | text-field--disabled__input-label | disabled={true} 时的标签样式 | | text-field--disabled__input-element | disabled={true} 时的 input 样式 | | text-field--disabled__input-line | disabled={true} 时的外框线样式 |