类型 InputOTPLayout

API 文档由 Go 源码生成,内容为英文。

type InputOTPLayout struct {
	Bounds        ui.Rect
	SlotSize      float32
	Slots         int
	GroupSize     int
	SeparatorSpan float32
}

InputOTPLayout describes the deterministic intrinsic geometry of an OTP row.

构造函数

PaintInputOTP#

func PaintInputOTP(canvas *ui.Canvas, theme ui.Theme, origin ui.Rect, snapshot InputOTPSnapshot) InputOTPLayout

PaintInputOTP paints the official grouped 32px native adaptation of the shadcn 36px slots and returns intrinsic layout information.

方法

SlotBounds#

func (layout InputOTPLayout) SlotBounds(index int) ui.Rect

SlotBounds returns one slot rectangle, or zero for an invalid index.