# Safe Area With the **expandSafeArea** attribute, you can expand a component's safe area. > **NOTE** > > This attribute is supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version. ## Attributes | Name | Parameter | Description | | -------------- | ----------------------------- | --------------------------------------- | | expandSafeArea | type?: Array <[SafeAreaType](ts-types.md#safeareatype10)>,
edges?: Array <[SafeAreaEdge](ts-types.md#safeareaedge10)> | Safe area to be expanded to.
Default value:
type: [SafeAreaType.SYSTEM, SafeAreaType.CUTOUT, SafeAreaType.KEYBOARD],
edges: [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM, SafeAreaEdge.START, SafeAreaEdge.END]
The default value expands the safe area to all available areas.
**type**: indicates the type of the extended security zone. This parameter is optional.
**edges**: edge for expanding the safe area. This parameter is optional.| ## Example ### Example 1 ``` // xxx.ets @Entry @Component struct SafeAreaExample1 { @State text: string = '' controller: TextInputController = new TextInputController() build() { Row() { Column() .height('100%').width('100%') .backgroundImage($r('app.media.bg')).backgroundImageSize(ImageSize.Cover) .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) }.height('100%') } } ``` ![expandSafeArea1](figures/expandSafeArea1.png) ### Example 2 ``` @Entry @Component struct SafeAreaExample { @State text: string = '' controller: TextInputController = new TextInputController() build() { Row() { Stack() { Column() .height('100%').width('100%') .backgroundImage($r('app.media.bg')).backgroundImageSize(ImageSize.Cover) .expandSafeArea([SafeAreaType.KEYBOARD, SafeAreaType.SYSTEM]) Column() { Button('Set caretPosition 1') .onClick(() => { this.controller.caretPosition(1) }) TextInput({ text: this.text, placeholder: 'input your word...', controller: this.controller }) .placeholderFont({ size: 14, weight: 400 }) .width(320).height(40).offset({y: 120}) .fontSize(14).fontColor(Color.Black) .backgroundColor(Color.White) }.width('100%').alignItems(HorizontalAlign.Center) } }.height('100%') } } ``` ![expandSafeArea2](figures/expandSafeArea2.png)