Skip to content

Text input

Single-line text — the workhorse of every admin form.

from almasix.orbit.forms import Form, TextInput
form = Form.make("demo").schema([
TextInput.make("title")
.label("Title")
.placeholder("Shipping Orbit docs")
.required()
.max_length(200)
])
from almasix.orbit import Resource
from almasix.orbit.forms import Form, TextInput
class PostResource(Resource):
@classmethod
def form(cls, form: Form) -> Form:
return form.schema([
TextInput.make("title").required().max_length(200),
TextInput.make("slug").helper_text("Used in URLs"),
TextInput.make("email").email(),
])
  • .label(...) / .placeholder(...) / .helper_text(...)
  • .required() / .rules(...)
  • .email() / .password() / .numeric() / .integer() / .tel() / .url()
  • .max_length(n) / .min_length(n)
  • .default(...) / .live() / .readonly() / .disabled(...) / .visible(...)

Closures work on .label(), .helper_text(), .placeholder(), .visible(), .disabled(), and .required() — see Form closures.

Orbit form example (light)

Orbit form example (dark)