An electronic device with a portable optical module (100) is provided. The
electronic device includes a main body (10) having a camera module (20)
incorporated therein, an optical element (40), a holder (50) and a
magnetic assembly (30). The optical element can be an optical filter. The
holder is annular-shaped and defines a through hole therein for
accommodating the optical element therein. The magnetic assembly includes
a first part coupled to the holder and a second part coupled to the
camera module. The first part is configured for magnetic attachment to
the second part, thus removably coupling the holder with the optical
element to the camera module.