Magic Keyboard, Magic Keyboard with Numeric Keypad, Magic Mouse 2, and Magic Trackpad 2 have a built-in rechargeable battery that lets you use the devices for extended periods between charges.
You can check your device's charge level by choosing its name from the Bluetooth icon in the menu bar at the top of the screen.
When it's time to charge your device's battery, connect a Lightning to USB cable to its Lightning port, then connect the other end of the cable to your Mac or a USB power adapter.
For the fastest battery charging performance, be sure your device is switched on when connecting the Lightning to USB cable.
Magic Keyboard, Magic Keyboard with Numeric Keypad, and Magic Trackpad 2 can be used while charging. Magic Mouse 2 is unavailable for use while charging.
Find the Lightning port on your Apple device
The Lightning port on Magic Keyboard and Magic Keyboard with Numeric Keypad is on the back of the device, in the center:
The Lightning port on Magic Mouse 2 is on the underside of the device, beneath the text and markings:
The Lightning port on Magic Trackpad 2 is on the back of the device, in the center: