Skip to content

Add corner_radius property to UI::View #8

@crimson-knight

Description

@crimson-knight

Context

When building cross-platform views, corner_radius (or border_radius in CSS terms) is a fundamental visual property that's expected on container views. Asset Pipeline's UI::View currently doesn't expose this property.

Problem

Setting rounded corners on views is not possible through the component API:

card = ::UI::VStack.new
card.background = ::UI::Color.new(0.2, 0.2, 0.2, 1.0)
card.corner_radius = 8.0  # Does not exist — compile error

This is a common UI pattern (cards, pills, rounded buttons, avatar frames) that currently has no path in the component system.

Proposal

Add a corner_radius property (type Float64, default 0.0) to UI::View:

property corner_radius : Float64 = 0.0

Platform Mapping

Platform Implementation
Web border-radius: {value}px
AppKit view.layer.cornerRadius = value (with wantsLayer = true)
UIKit view.layer.cornerRadius = value
Android GradientDrawable with setCornerRadius(value) or ShapeAppearanceModel

Priority

This is a commonly needed visual property. Most native UI frameworks (SwiftUI, Jetpack Compose, Flutter) have this as a first-class property on their base view types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions