An electronic device includes a supporting plate, at least one main positioning magnet and a body. The supporting plate has an edge. The supporting plate is provided with a first positioning magnet structure therein. The main positioning magnet is disposed at the supporting plate. The body is movably disposed at the supporting plate, wherein the body has a first axis and a second axis intersected with the first axis. The body is provided with a main auxiliary magnet and a first auxiliary magnet structure therein. The main auxiliary magnet is located at the intersection of the first axis and the second axis, and the first auxiliary magnet structure is located on the first axis. The main auxiliary magnet is configured to be aligned with the main positioning magnet and magnetically attracted to the main positioning magnet.