Keyboards

The system provides several types of onscreen keyboards, each designed to facilitate a different type of input. People can also connect an external keyboard to their iPad. When an external keyboard is available, people expect your app to support it by enabling keyboard shortcuts and keyboard navigation.

Match the onscreen keyboard to the type of content people are editing. For example, you can help people enter numeric data by providing the numbers and punctuation keyboard. For developer guidance, see UIKeyboardType.

  • Alphabet A partial screenshot of a keyboard on iPhone that displays all 26 letter keys in addition to the Shift, Delete, Numbers, Space, and Return keys. Typing suggestions appear above the keyboard and the Dictation button appears below it.
  • ASCII Capable A partial screenshot of a keyboard on iPhone that displays all 26 letter keys in addition to the Shift, Delete, Numbers, Space, and Return keys. Typing suggestions appear above the keyboard and the Dictation button appears below it.
  • ASCII Capable Number Pad A partial screenshot of a keyboard on iPhone that displays all 10 number keys in addition to the Delete key. Keys for the numbers 2 through 9 each include the 3 or 4 letters associated with the number on a phone.
  • Decimal Pad A partial screenshot of a keyboard on iPhone that displays all 10 number keys in addition to the Delete and period keys. Keys for the numbers 2 through 9 each include the 3 or 4 letters associated with the number on a phone.
  • Default A partial screenshot of a keyboard on iPhone that displays all 26 letter keys in addition to the Shift, Delete, Numbers, Space, and Return keys. Typing suggestions appear above the keyboard and the  Emoji and Dictation buttons appear below it.
  • Email Address A partial screenshot of a keyboard on iPhone that displays all 26 letter keys in addition to the Shift, Delete, Numbers, Space, period, at symbol, and Return keys. Typing suggestions appear above the keyboard and the Emoji button appears below it.
  • Name Phone Pad A partial screenshot of a keyboard on iPhone that displays all 26 letter keys in addition to the Shift, Delete, Numbers, Space, and Return keys. Typing suggestions appear above the keyboard and the Emoji and Dictation buttons appear below it.
  • Number Pad A partial screenshot of a keyboard on iPhone that displays all 10 number keys in addition to the Delete key. Keys for the numbers 2 through 9 each include the 3 or 4 letters associated with the number on a phone.
  • Numbers and Punctuation A partial screenshot of a keyboard on iPhone that displays 10 number and 15 punctuation keys in addition to the secondary punctuation key, and the Delete, Letters, Space, and Return keys. Typing suggestions appear above the keyboard and the Dictation button appears below it.
  • Phone Pad A partial screenshot of a keyboard on iPhone that displays all 10 number keys in addition to the Delete key and a key for plus, star, and hash. Keys for the numbers 2 through 9 each include the 3 or 4 letters associated with the number on a phone.
  • Twitter A partial screenshot of a keyboard on iPhone that displays all 26 letter keys in addition to the Shift, Delete, Numbers, Space, at symbol, and hash keys. Typing suggestions appear above the keyboard and the Emoji and Dictation buttons appear below it.
  • URL
    A partial screenshot of a keyboard on iPhone that displays all 26 letter keys in addition to the Shift, Delete, Numbers, period, slash, dot com, and Return keys. Typing suggestions appear above the keyboard and the Emoji button appears below it.
  • Web Search A partial screenshot of a keyboard on iPhone that displays all 26 letter keys in addition to the Shift, Delete, Numbers, Space, period, and Go keys. Typing suggestions appear above the keyboard and the Emoji and Dictation buttons appear below it.

Use the keyboard layout guide to make the keyboard feel like an integrated part of your interface. Using the layout guide also ensures that important UI remains accessible while the keyboard is onscreen. For guidance, see Layout Guides and Safe Areas.

A diagram of an app layout on iPhone, showing two text fields and a button above the keyboard. An image of a white checkmark in a green circle to indicate a correct example.

When you use the keyboard layout guide, app UI and the keyboard work well together.

A diagram of an app layout on iPhone, showing the keyboard covering part of a text field. An image of a white X in a gray circle to indicate an incorrect example.

If you don’t use the keyboard layout guide, the keyboard might obscure UI, such as a text field...

A diagram of an app layout on iPhone, showing the keyboard covering part of a button. An image of a white X in a gray circle to indicate an incorrect example.

...or a button.

To learn about creating a custom keyboard, see Custom Keyboards.

Responding to Keyboard Shortcuts on iPad

Keyboard shortcuts help people efficiently perform actions using only a hardware keyboard. iPad apps can support keyboard shortcuts for the system-defined commands — such as Undo, Redo, Paste and Match Style, and Print — in addition to providing custom shortcuts for app-specific commands.

In iPadOS 15 and later, an app’s keyboard shortcuts appear in the shortcut interface that displays when people hold the Command key. Similar in organization to an app’s menu bar menus on a Mac, the shortcut interface on iPad displays app commands in familiar system-defined menu categories such as File, Edit, and View. Unlike menu bar menus, the iPad interface displays all relevant categories in one view, listing within each category only available commands that also have shortcuts.

A partial screenshot of the keyboard shortcut interface in the Maps app on iPad. The interface lists shortcuts for commands such as Drop Pin and Switch to Explore.

Because iPadOS keyboard shortcuts rely on the menu system, you add new shortcuts by adding new commands to the menu. For developer guidance, see UIMenuBuilder.

Avoid using the shortcut interface as the primary way to offer app functionality. The shortcut interface helps people learn about the keyboard shortcuts available to them, but it doesn’t list all the commands your app supports. Continue to use contextually relevant ways to present app functionality, like buttons and toolbars (for guidance, see Buttons and Toolbars).

Enable the system-defined keyboard shortcuts that make sense in your app. Help people learn your app quickly by supporting the system-defined keyboard shortcuts they already know.

Define new keyboard shortcuts for only the most common actions in your app. People appreciate using keyboard shortcuts for app-specific actions they perform frequently, but defining too many new shortcuts can clutter the shortcut interface and risk making your app seem difficult to learn. Minimizing app-specific keyboard shortcuts also helps avoid potential conflicts with system-defined shortcuts that may be in place. For guidance, see Defining Keyboard Shortcuts.

In general, don’t repurpose standard keyboard shortcuts for custom actions. People can get confused when the shortcuts they know work differently in your app. Only consider redefining a standard shortcut if its action doesn’t make sense in your app. For example, an app that doesn’t support text editing doesn’t need a text-styling command like Italic, so it might use Command–I for an action that has more relevance in the app, such as Get Info.

Provide descriptive command titles that help people discover available actions. Because the iPad shortcut interface displays a flat list of all items in each category, submenu titles aren’t available to provide context for their child items. For example, the item titles Name and Date Added don’t make sense without the context of the submenu title Sort Bookmarks By. You can enhance each item’s title by including the necessary context, such as Sort Bookmarks by Name and Sort Bookmarks by Date Added. For developer guidance, see discoverabilityTitle.

Let the system localize and mirror your keyboard shortcuts as needed. iPadOS automatically localizes a shortcut’s primary key and modifier keys to support the currently connected keyboard. Also, if your app switches to a right-to-left layout, the system automatically mirrors the shortcut. For related guidance, see Right to Left.

Support expected modifiers on drag interactions. For example, pressing Command while dragging moves items as a group; pressing Shift while drag-resizing constrains resizing to the item’s aspect ratio.

Meet people’s expectations when they continuously hold down a key. For example, holding an arrow key moves the selected item by the smallest app-defined unit of distance until people release the key.

Supporting Keyboard Navigation on iPad

Keyboard navigation lets people use a hardware keyboard to navigate an app’s key features and select items. By default, iPadOS 15 enables keyboard navigation in text fields, text views, and sidebars, providing APIs you can use to enable it in various types of collection views and other custom views in your app. For developer guidance, see Focus-Based Navigation.

IMPORTANT Avoid enabling keyboard navigation for controls, such as buttons, segmented controls, and switches. Full keyboard access already helps people activate controls, navigate to all onscreen elements, and even perform gesture-based interactions like drag and drop.

Beginning in iPadOS 15, keyboard navigation relies on the tvOS focus system, in which people perform actions by moving a focus indicator to an item and then selecting it (to learn more, see Focus and Selection). Although the underlying system is the same, the user experiences are a little different. tvOS uses directional focus, which means that people can use the same interaction — that is, swiping the Siri Remote or using only the arrow keys on a connected keyboard — to navigate to every onscreen element. In contrast, iPadOS defines focus groups, which represent specific areas within an app, like a sidebar, grid, or list. Using focus groups, iPadOS can support two different keyboard interactions.

  • Pressing the Tab key moves focus among focus groups, letting people navigate to sidebars, grids, and other app areas.
  • Pressing an arrow key enables a directional focus interaction that’s similar to tvOS, but limited to navigation among items in the same focus group. For example, people can use an arrow key to move through the items in a list or a sidebar.

Onscreen elements can indicate focus by using the halo effect or the highlighted appearance.

The halo focus effect — also known as the focus ring — displays a customizable outline around the element. You can apply the halo effect to custom views and to fully opaque content within a collection or list cell, such as an image.

A partial screenshot of a photo collection on iPad, where the halo effect outlines the focused photo.

Photos uses the halo effect to indicate the focused photo in a collection.

Customize the halo focus effect when necessary. By default, the system uses an item’s shape to infer the shape of its halo. If the system-provided halo doesn’t give you the appearance you want, you can refine it to match contours like rounded corners or shapes defined by Bezier paths. You can also adjust a halo’s position if another element occludes or clips it. For example, you might need to ensure that a badge appears above the halo or that a parent view doesn’t clip it. For developer guidance, see UIFocusHaloEffect.

A partial screenshot of the Albums view in Photos, where a rounded halo outlines the focused album.

Photos uses a rounded-corner halo to match the corners of the focused album’s thumbnail.

The highlighted appearance — in which the element’s background uses the app’s tint color — also indicates focus, but it’s not a focus effect. The highlight appearance occurs automatically when people select a collection view cell on which you’ve set background and content configurations (for developer guidance, see UICollectionViewCell).

A partial screenshot of the sidebar in Photos, where a solid rounded rectangle appears behind the selected item.

Photos uses the highlighted appearance to indicate the selected item in the sidebar.

Ensure that focus moves through your custom views in ways that make sense. As people continue pressing the Tab key, focus moves through focus groups in reading order: leading to trailing, and top to bottom. Although focus moves through system-provided views in ways that people expect, you might need to adjust the order in which the focus system visits your custom views. For example, if you want focus to move down through a vertical stack of custom views before it moves in the trailing direction to the next view, you need to identify the stack container as a single focus group. For developer guidance, see focusGroupIdentifier.

Adjust the priority of an item to reflect its importance within a focus group. When a group receives focus, its primary item automatically receives focus too, making it easy for people to select the item they’re most likely to want. You can make an item primary by increasing its priority. For developer guidance, see UIFocusGroupPriority.