Yes, electronic logbooks are entirely legal. The FAA does not have a specific rule on the format in which a logbook is maintained, merely that one be maintained that ‘satisfies the Administration.’
That has allowed quite a healthy market in electronic logbook hardware and software to develop, though technically, you could use something as universal as an Excel spreadsheet to electronically log your flight hours, and it would be acceptable to the Administration.
There are a wide variety of electronic logbook apps available, each with their own features. Some pull data from instrument sources, some allow you to update your records by uploading files in a wide variety of file types, like TXT, PDF, or CSV.
At least for now, the option exists with many electronic logbook apps to send the data across to specialized logbook publishers, and so get the ease of use that comes with electronic flight time logging, matched with the hard copy practicality of a standard logbook.
It’s also worth noting that a lot of electronic logbook apps have a range of additional features you can use, and are backed up by the likes of Youtube tutorials, to make sure you never go wrong in logging your flight time.
On the other hand, some such electronic logbook apps start out free and charge you a subscription fee once you’ve logged over, for instance, 250 hours of flight time. With a hard copy logbook, you pay just the once.